This commit is contained in:
neaggarwMS 2020-07-16 09:55:33 -07:00
Родитель 3e404bfcff
Коммит 4a90d00962
2 изменённых файлов: 14 добавлений и 13 удалений

Просмотреть файл

@ -30,18 +30,18 @@ var (
}
)
func addTestStateToRestServer(svc *restserver.HTTPRestService) {
// set state as already allocated
state1, _ := restserver.NewPodStateWithOrchestratorContext(testIP1, 24, testPod1GUID, testNCID, cns.Available, testPod1Info)
ipconfigs := map[string]cns.ContainerIPConfigState{
state1.ID: state1,
}
nc := cns.CreateNetworkContainerRequest{
SecondaryIPConfigs: ipconfigs,
}
// func addTestStateToRestServer(svc *restserver.HTTPRestService) {
// // set state as already allocated
// state1, _ := restserver.NewPodStateWithOrchestratorContext(testIP1, 24, testPod1GUID, testNCID, cns.Available, testPod1Info)
// ipconfigs := map[string]cns.SecondaryIPConfig{
// state1.ID: state1,
// }
// nc := cns.CreateNetworkContainerRequest{
// SecondaryIPConfigs: ipconfigs,
// }
svc.CreateOrUpdateNetworkContainerWithSecondaryIPConfigs(nc)
}
// svc.CreateOrUpdateNetworkContainerWithSecondaryIPConfigs(nc)
// }
func getIPConfigFromGetNetworkContainerResponse(resp *cns.GetIPConfigResponse) (net.IPNet, error) {
var (
@ -98,7 +98,7 @@ func TestMain(m *testing.M) {
return
}
addTestStateToRestServer(svc)
//addTestStateToRestServer(svc)
if httpRestService != nil {
err = httpRestService.Start(&config)

Просмотреть файл

@ -139,7 +139,8 @@ func validateIPConfig(ipconfig cns.ContainerIPConfigState) error {
}
func (service *HTTPRestService) CreateOrUpdateNetworkContainerWithSecondaryIPConfigs(nc cns.CreateNetworkContainerRequest) error {
return service.addIPConfigsToState(nc.SecondaryIPConfigs)
//return service.addIPConfigsToState(nc.SecondaryIPConfigs)
return nil
}
//AddIPConfigsToState takes a lock on the service object, and will add an array of ipconfigs to the CNS Service.