Skip to content

Commit 5600959

Browse files
committed
removing todos
1 parent 7241b09 commit 5600959

File tree

5 files changed

+0
-13
lines changed

5 files changed

+0
-13
lines changed

cns/middlewares/k8sSwiftV2.go

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,6 @@ var _ cns.IPConfigsHandlerMiddleware = (*K8sSWIFTv2Middleware)(nil)
3838

3939
// IPConfigsRequestHandlerWrapper is the middleware function for handling SWIFT v2 IP configs requests for AKS-SWIFT. This function wrapped the default SWIFT request
4040
// and release IP configs handlers.
41-
// TODO: this will need to changed or add a new function to also work for a delegated NIC with multiple pods
4241
func (k *K8sSWIFTv2Middleware) IPConfigsRequestHandlerWrapper(defaultHandler, failureHandler cns.IPConfigsHandlerFunc) cns.IPConfigsHandlerFunc {
4342
return func(ctx context.Context, req cns.IPConfigsRequest) (*cns.IPConfigsResponse, error) {
4443
podInfo, respCode, message := k.validateIPConfigsRequest(ctx, &req)
@@ -53,11 +52,9 @@ func (k *K8sSWIFTv2Middleware) IPConfigsRequestHandlerWrapper(defaultHandler, fa
5352
}
5453
ipConfigsResp, err := defaultHandler(ctx, req)
5554
// If the pod is not v2, return the response from the handler
56-
// we need to add the secondary Interface. Our current POC cluster is returning here
5755
if !req.SecondaryInterfacesExist {
5856
return ipConfigsResp, err
5957
}
60-
// TODO: the pod itself won't be "V2" as we aren't using multitenancy pods
6158
// If the pod is v2, get the infra IP configs from the handler first and then add the SWIFTv2 IP config
6259
defer func() {
6360
// Release the default IP config if there is an error
@@ -103,7 +100,6 @@ func (k *K8sSWIFTv2Middleware) IPConfigsRequestHandlerWrapper(defaultHandler, fa
103100
}
104101
}
105102

106-
// TODO: we will not be using multitenant pods. Need to look into what labels we are currently seeing and maybe compare to Vanilla swiftv2
107103
// For our purposes we would skip over this logic or need to replace it with something to check the delegated NIC
108104
// validateIPConfigsRequest validates if pod is multitenant by checking the pod labels, used in SWIFT V2 AKS scenario.
109105
// nolint

cns/middlewares/k8sSwiftV2_linux.go

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,6 @@ func (k *K8sSWIFTv2Middleware) setRoutes(podIPInfo *cns.PodIpInfo) error {
1818
var routes []cns.Route
1919

2020
switch podIPInfo.NICType {
21-
// TODO: We may want to create a new type of NIC. Currently we are using delegated NICs but this set routes method only
22-
// takes in for the multitenant scenario. We should have a new case that behaves similarly to InfraNIC but for a delegated NIC
23-
// Q: Does the code currently see the kube pods as Infra or Delegated? They currently use the delegated pod subnet for IPs
2421
case cns.DelegatedVMNIC:
2522
virtualGWRoute := cns.Route{
2623
IPAddress: fmt.Sprintf("%s/%d", virtualGW, prefixLength),
@@ -68,7 +65,6 @@ func (k *K8sSWIFTv2Middleware) setRoutes(podIPInfo *cns.PodIpInfo) error {
6865
return errors.Wrapf(err, "failed to parse podIPConfig IP address %s", podIPInfo.PodIPConfig.IPAddress)
6966
}
7067

71-
//This function is called per IP so we shouldn't have to worry about adding both v4 and v6 at once
7268
if ip.Is4() {
7369
routes = append(routes, addRoutes(podCIDRsV4, overlayGatewayv4)...)
7470
routes = append(routes, addRoutes(serviceCIDRsV4, overlayGatewayv4)...)

cns/middlewares/k8sSwiftV2_windows.go

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,6 @@ func (k *K8sSWIFTv2Middleware) setRoutes(podIPInfo *cns.PodIpInfo) error {
2727

2828
// assignSubnetPrefixLengthFields will assign the subnet-prefix length to some fields of podipinfo
2929
// this is required for the windows scenario so that HNS programming is successful for pods
30-
// TODO: This is being used for the delegated NIC for Windows solution. Once we are testing Windows we will
31-
// Need to confirm that this assigns the whole pod subnet that we expect for both v4 and v6
3230
func (k *K8sSWIFTv2Middleware) assignSubnetPrefixLengthFields(podIPInfo *cns.PodIpInfo, interfaceInfo v1alpha1.InterfaceInfo, ip string) error {
3331
// Parse MTPNC SubnetAddressSpace to get the subnet prefix length
3432
subnet, subnetPrefix, err := utils.ParseIPAndPrefix(interfaceInfo.SubnetAddressSpace)

cns/restserver/ipam.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -283,7 +283,6 @@ func (service *HTTPRestService) RequestIPConfigsHandler(w http.ResponseWriter, r
283283
}
284284
var ipConfigsResp *cns.IPConfigsResponse
285285

286-
// TODO: Decide what middleware option we need to singetenancy swift v2
287286
// Check if IPConfigsHandlerMiddleware is set
288287
if service.IPConfigsHandlerMiddleware != nil {
289288
// Wrap the default datapath handlers with the middleware depending on middleware type

cns/service/main.go

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1404,7 +1404,6 @@ func InitializeCRDState(ctx context.Context, httpRestService cns.HTTPService, cn
14041404

14051405
// Start building the NNC Reconciler
14061406

1407-
// TODO: We need to return the IPFamilies from the reconciler so that they can be added to the Service struct
14081407
// get CNS Node IP to compare NC Node IP with this Node IP to ensure NCs were created for this node
14091408
nodeIP := configuration.NodeIP()
14101409
nncReconciler := nncctrl.NewReconciler(httpRestServiceImplementation, poolMonitor, nodeIP)
@@ -1435,7 +1434,6 @@ func InitializeCRDState(ctx context.Context, httpRestService cns.HTTPService, cn
14351434
}
14361435
}
14371436

1438-
// TODO: If we need special middleware this is where we would be setting it
14391437
if cnsconfig.EnableSwiftV2 {
14401438
if err := mtpncctrl.SetupWithManager(manager); err != nil {
14411439
return errors.Wrapf(err, "failed to setup mtpnc reconciler with manager")

0 commit comments

Comments
 (0)