File tree Expand file tree Collapse file tree 1 file changed +3
-3
lines changed Expand file tree Collapse file tree 1 file changed +3
-3
lines changed Original file line number Diff line number Diff line change @@ -681,6 +681,9 @@ func (service *HTTPRestService) GetExistingIPConfig(podInfo cns.PodInfo) ([]cns.
681681
682682// Assigns a pod with all IPs desired
683683func (service * HTTPRestService ) AssignDesiredIPConfigs (podInfo cns.PodInfo , desiredIPAddresses []string ) ([]cns.PodIpInfo , error ) {
684+ service .Lock ()
685+ defer service .Unlock ()
686+
684687 // Gets the number of NCs which will determine the number of IPs given to a pod
685688 numOfNCs := len (service .state .ContainerStatus )
686689 // checks to make sure we have NCs before trying to get IPs
@@ -696,9 +699,6 @@ func (service *HTTPRestService) AssignDesiredIPConfigs(podInfo cns.PodInfo, desi
696699 // slice to keep track of IP configs to assign
697700 ipConfigsToAssign := make ([]cns.IPConfigurationStatus , 0 )
698701
699- service .Lock ()
700- defer service .Unlock ()
701-
702702 for _ , desiredIP := range desiredIPAddresses {
703703 desiredIPMap [desiredIP ] = struct {}{}
704704 }
You can’t perform that action at this time.
0 commit comments