@@ -1306,7 +1306,8 @@ func InitializeCRDState(ctx context.Context, httpRestService cns.HTTPService, cn
13061306 // Create the base NNC CRD if HomeAz is enabled
13071307 if cnsconfig .EnableHomeAz {
13081308 homeAzResponse := httpRestServiceImplementation .GetHomeAz (ctx )
1309- logger .Printf ("[Azure CNS] HomeAz: %s" , strconv .FormatUint (uint64 (homeAzResponse .HomeAzResponse .HomeAz ), 10 ))
1309+ az := int64 (homeAzResponse .HomeAzResponse .HomeAz )
1310+ logger .Printf ("[Azure CNS] HomeAz: %s" , strconv .FormatInt (az , 10 ))
13101311 // Create Node Network Config CRD and update the Home Az field with the cache value from the HomeAz Monitor
13111312 var nnc * v1alpha.NodeNetworkConfig
13121313 if nnc , err = directnnccli .Get (ctx , types.NamespacedName {Namespace : "kube-system" , Name : nodeName }); err != nil {
@@ -1316,13 +1317,13 @@ func InitializeCRDState(ctx context.Context, httpRestService cns.HTTPService, cn
13161317 newNNC := createBaseNNC (node )
13171318 if nnc == nil {
13181319 logger .Printf ("[Azure CNS] Creating new base NNC" )
1319- newNNC .Spec .AvailabilityZone = strconv . FormatUint ( uint64 ( homeAzResponse . HomeAzResponse . HomeAz ), 10 )
1320+ newNNC .Spec .AvailabilityZone = az
13201321 if err = directcli .Create (ctx , newNNC ); err != nil {
13211322 return errors .Wrap (err , "failed to create base NNC" )
13221323 }
13231324 } else {
1324- logger .Printf ("[Azure CNS] Patching existing NNC with new Spec with HomeAz" )
1325- newNNC .Spec .AvailabilityZone = strconv . FormatUint ( uint64 ( homeAzResponse . HomeAzResponse . HomeAz ), 10 )
1325+ logger .Printf ("[Azure CNS] Patching existing NNC with new Spec with HomeAz %d" , az )
1326+ newNNC .Spec .AvailabilityZone = az
13261327 newNNC .Spec .RequestedIPCount = nnc .Spec .RequestedIPCount
13271328 newNNC .Spec .IPsNotInUse = nnc .Spec .IPsNotInUse
13281329 newNNC .Status = nnc .Status
0 commit comments