Skip to content

Commit

Permalink
fixing comments
Browse files Browse the repository at this point in the history
  • Loading branch information
rjdenney committed Nov 18, 2024
1 parent b3f6924 commit 4cd14b6
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 2 deletions.
1 change: 0 additions & 1 deletion cns/middlewares/k8sSwiftV2.go
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,6 @@ func (k *K8sSWIFTv2Middleware) IPConfigsRequestHandlerWrapper(defaultHandler, fa
}
}

// For our purposes we would skip over this logic or need to replace it with something to check the delegated NIC
// validateIPConfigsRequest validates if pod is multitenant by checking the pod labels, used in SWIFT V2 AKS scenario.
// nolint
func (k *K8sSWIFTv2Middleware) validateIPConfigsRequest(ctx context.Context, req *cns.IPConfigsRequest) (podInfo cns.PodInfo, respCode types.ResponseCode, message string) {
Expand Down
2 changes: 2 additions & 0 deletions cns/restserver/ipam.go
Original file line number Diff line number Diff line change
Expand Up @@ -998,12 +998,14 @@ func (service *HTTPRestService) AssignAvailableIPConfigs(podInfo cns.PodInfo) ([
return nil, ErrNoNCs
}

// Gets the IPFamilies from all NCs and stores them in a map. This will be ued to determine the amount of IPs to return
for ncID := range service.state.ContainerStatus {
for ipFamily := range service.state.ContainerStatus[ncID].CreateNetworkContainerRequest.IPFamilies {
ipFamilies[ipFamily] = struct{}{}
}
}

// Makes sure we have at least one IPFamily across all NCs
numOfIPFamilies := len(ipFamilies)
if numOfIPFamilies == 0 {
return nil, ErrNoIPFamilies
Expand Down
1 change: 0 additions & 1 deletion cns/restserver/restserver.go
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,6 @@ type imdsClient interface {
}

// HTTPRestService represents http listener for CNS - Container Networking Service.
// TODO: If we add a new type of Middleware that will be reflected in the IPConfigsHandlerMiddleware value
type HTTPRestService struct {
*cns.Service
dockerClient *dockerclient.Client
Expand Down

0 comments on commit 4cd14b6

Please sign in to comment.