File tree Expand file tree Collapse file tree 1 file changed +14
-0
lines changed Expand file tree Collapse file tree 1 file changed +14
-0
lines changed Original file line number Diff line number Diff line change @@ -742,6 +742,20 @@ func (rm *resourceManager) updateComputeConfig(
742
742
exit := rlog .Trace ("rm.updateComputeConfig" )
743
743
defer exit (err )
744
744
745
+ // Safety check: ensure ComputeConfig is not nil
746
+ if r == nil || r .ko == nil || r .ko .Spec .ComputeConfig == nil {
747
+ rlog .Debug ("skipping updateComputeConfig: ComputeConfig is nil" )
748
+ return nil
749
+ }
750
+
751
+ // Safety check: ensure all required configurations are not nil
752
+ if r .ko .Spec .StorageConfig == nil || r .ko .Spec .StorageConfig .BlockStorage == nil {
753
+ return fmt .Errorf ("invalid Auto Mode configuration: StorageConfig.BlockStorage is required" )
754
+ }
755
+ if r .ko .Spec .KubernetesNetworkConfig == nil || r .ko .Spec .KubernetesNetworkConfig .ElasticLoadBalancing == nil {
756
+ return fmt .Errorf ("invalid Auto Mode configuration: KubernetesNetworkConfig.ElasticLoadBalancing is required" )
757
+ }
758
+
745
759
// Convert []*string to []string for NodePools
746
760
nodePools := make ([]string , 0 , len (r .ko .Spec .ComputeConfig .NodePools ))
747
761
for _ , nodePool := range r .ko .Spec .ComputeConfig .NodePools {
You can’t perform that action at this time.
0 commit comments