Skip to content

Commit 170ecaf

Browse files
authored
feat: Adding placeholders for NNC creation logic
1 parent dc46fbb commit 170ecaf

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

cns/service/main.go

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1271,11 +1271,6 @@ func InitializeCRDState(ctx context.Context, httpRestService cns.HTTPService, cn
12711271
}
12721272
}
12731273

1274-
if cnsconfig.EnableHomeAz {
1275-
// Create Node Network Config CRD and update the Home Az field with the cache value from the HomeAz Monitor
1276-
createOrUpdateNNC(ctx)
1277-
}
1278-
12791274
// perform state migration from CNI in case CNS is set to manage the endpoint state and has emty state
12801275
if cnsconfig.EnableStateMigration && !httpRestServiceImplementation.EndpointStateStore.Exists() {
12811276
if err = PopulateCNSEndpointState(httpRestServiceImplementation.EndpointStateStore); err != nil {
@@ -1304,7 +1299,12 @@ func InitializeCRDState(ctx context.Context, httpRestService cns.HTTPService, cn
13041299
// TODO(rbtr): nodename and namespace should be in the cns config
13051300
directscopedcli := nncctrl.NewScopedClient(directnnccli, types.NamespacedName{Namespace: "kube-system", Name: nodeName})
13061301

1307-
// TODO: Create the NNC CRD here and update it with HomeAzinfo
1302+
nnc := v1alpha.NodeNetworkConfig{}
1303+
if cnsconfig.EnableHomeAz {
1304+
// Create Node Network Config CRD and update the Home Az field with the cache value from the HomeAz Monitor
1305+
nnc = createBaseNNC(ctx, node)
1306+
}
1307+
directcli.Create(ctx, &nnc)
13081308

13091309
logger.Printf("Reconciling initial CNS state")
13101310
// apiserver nnc might not be registered or api server might be down and crashloop backof puts us outside of 5-10 minutes we have for

0 commit comments

Comments
 (0)