Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions cns/restserver/ipam.go
Original file line number Diff line number Diff line change
Expand Up @@ -681,6 +681,9 @@ func (service *HTTPRestService) GetExistingIPConfig(podInfo cns.PodInfo) ([]cns.

// Assigns a pod with all IPs desired
func (service *HTTPRestService) AssignDesiredIPConfigs(podInfo cns.PodInfo, desiredIPAddresses []string) ([]cns.PodIpInfo, error) {
service.Lock()
defer service.Unlock()

// Gets the number of NCs which will determine the number of IPs given to a pod
numOfNCs := len(service.state.ContainerStatus)
// checks to make sure we have NCs before trying to get IPs
Expand All @@ -696,9 +699,6 @@ func (service *HTTPRestService) AssignDesiredIPConfigs(podInfo cns.PodInfo, desi
// slice to keep track of IP configs to assign
ipConfigsToAssign := make([]cns.IPConfigurationStatus, 0)

service.Lock()
defer service.Unlock()

for _, desiredIP := range desiredIPAddresses {
desiredIPMap[desiredIP] = struct{}{}
}
Expand Down