@@ -666,37 +666,54 @@ func (rm *resourceManager) updateComputeConfig(
666666 exit := rlog .Trace ("rm.updateComputeConfig" )
667667 defer exit (err )
668668
669- // Convert []*string to []string for NodePools
670- nodePools := make ([]string , 0 , len (r .ko .Spec .ComputeConfig .NodePools ))
671- for _ , nodePool := range r .ko .Spec .ComputeConfig .NodePools {
672- if nodePool != nil {
673- nodePools = append (nodePools , * nodePool )
674- }
675- }
676-
669+ // All three fields must be initialized for EKS Auto Mode to be properly toggled.
677670 input := & svcsdk.UpdateClusterConfigInput {
678- Name : r .ko .Spec .Name ,
679- ComputeConfig : & svcsdktypes.ComputeConfigRequest {
680- Enabled : r .ko .Spec .ComputeConfig .Enabled ,
681- NodePools : nodePools , // Use the converted []string slice
682- NodeRoleArn : r .ko .Spec .ComputeConfig .NodeRoleARN ,
683- },
671+ Name : r .ko .Spec .Name ,
672+ ComputeConfig : & svcsdktypes.ComputeConfigRequest {},
684673 StorageConfig : & svcsdktypes.StorageConfigRequest {
685- BlockStorage : & svcsdktypes.BlockStorage {
686- Enabled : r .ko .Spec .StorageConfig .BlockStorage .Enabled ,
687- },
674+ BlockStorage : & svcsdktypes.BlockStorage {},
688675 },
689676 KubernetesNetworkConfig : & svcsdktypes.KubernetesNetworkConfigRequest {
690- ElasticLoadBalancing : & svcsdktypes.ElasticLoadBalancing {
691- Enabled : r .ko .Spec .KubernetesNetworkConfig .ElasticLoadBalancing .Enabled ,
692- },
693- IpFamily : svcsdktypes .IpFamily (* r .ko .Spec .KubernetesNetworkConfig .IPFamily ),
694- ServiceIpv4Cidr : r .ko .Spec .KubernetesNetworkConfig .ServiceIPv4CIDR ,
677+ ElasticLoadBalancing : & svcsdktypes.ElasticLoadBalancing {},
695678 },
696679 }
697680
681+ // Process compute configs
682+ if r .ko .Spec .ComputeConfig != nil {
683+ // Convert []*string to []string for NodePools
684+ nodePools := make ([]string , 0 , len (r .ko .Spec .ComputeConfig .NodePools ))
685+ for _ , nodePool := range r .ko .Spec .ComputeConfig .NodePools {
686+ if nodePool != nil {
687+ nodePools = append (nodePools , * nodePool )
688+ }
689+ }
690+
691+ input .ComputeConfig .Enabled = r .ko .Spec .ComputeConfig .Enabled
692+ input .ComputeConfig .NodePools = nodePools // Use the converted []string slice
693+ input .ComputeConfig .NodeRoleArn = r .ko .Spec .ComputeConfig .NodeRoleARN
694+ }
695+
696+ // Process storage configs
697+ if r .ko .Spec .StorageConfig != nil && r .ko .Spec .StorageConfig .BlockStorage != nil {
698+ input .StorageConfig .BlockStorage .Enabled = r .ko .Spec .StorageConfig .BlockStorage .Enabled
699+ }
700+
701+ // Process network configs
702+ if r .ko .Spec .KubernetesNetworkConfig != nil {
703+ if r .ko .Spec .KubernetesNetworkConfig .ElasticLoadBalancing != nil {
704+ input .KubernetesNetworkConfig .ElasticLoadBalancing .Enabled = r .ko .Spec .KubernetesNetworkConfig .ElasticLoadBalancing .Enabled
705+ }
706+
707+ if r .ko .Spec .KubernetesNetworkConfig .IPFamily != nil {
708+ input .KubernetesNetworkConfig .IpFamily = svcsdktypes .IpFamily (* r .ko .Spec .KubernetesNetworkConfig .IPFamily )
709+ }
710+
711+ input .KubernetesNetworkConfig .ServiceIpv4Cidr = r .ko .Spec .KubernetesNetworkConfig .ServiceIPv4CIDR
712+ }
713+
698714 _ , err = rm .sdkapi .UpdateClusterConfig (ctx , input )
699715 rm .metrics .RecordAPICall ("UPDATE" , "UpdateClusterConfig" , err )
716+
700717 if err != nil {
701718 return err
702719 }
0 commit comments