Skip to content

Commit cb1c6a4

Browse files
committed
Adding the support for skip_k8s_upgrade and unit test addition
1 parent 86202e7 commit cb1c6a4

File tree

3 files changed

+2
-3
lines changed

3 files changed

+2
-3
lines changed

spectrocloud/resource_cluster_aws.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -529,7 +529,7 @@ func flattenMachinePoolConfigsAws(machinePools []*models.V1AwsMachinePoolConfig)
529529
oi["max_price"] = machinePool.SpotMarketOptions.MaxPrice
530530
}
531531
// Flatten skip_k8s_upgrade (worker pools only); default "disabled" for backward compat when API omits field
532-
if machinePool.SkipK8sUpgrade != nil {
532+
if machinePool.SkipK8sUpgrade != nil && *machinePool.SkipK8sUpgrade != "" {
533533
oi["skip_k8s_upgrade"] = *machinePool.SkipK8sUpgrade
534534
}
535535
oi["disk_size_gb"] = int(machinePool.RootDeviceSize)

spectrocloud/resource_cluster_aws_expand_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,8 +91,8 @@ func TestToMachinePoolAws(t *testing.T) {
9191
IsControlPlane: false,
9292
Labels: []string{"worker"},
9393
NodeRepaveInterval: 10,
94-
SkipK8sUpgrade: types.Ptr("disabled"),
9594
UpdateStrategy: &models.V1UpdateStrategy{Type: "RollingUpdateScaleOut"},
95+
SkipK8sUpgrade: types.Ptr("disabled"),
9696
AdditionalLabels: map[string]string{},
9797
AdditionalAnnotations: map[string]string{},
9898
},

spectrocloud/resource_cluster_aws_flatten_test.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,6 @@ func TestFlattenMachinePoolConfigsAws(t *testing.T) {
6060
"disk_size_gb": 8,
6161
"az_subnets": map[string]string{"us-west-2d": "subnet-87654321"},
6262
"update_strategy": "RollingUpdateScaleOut",
63-
"skip_k8s_upgrade": "disabled",
6463
"additional_security_groups": []string{"sg-1234567890"},
6564
},
6665
},

0 commit comments

Comments
 (0)