Skip to content

Commit a8fbf28

Browse files
authored
Modify state upgrader to remove ebs_volume_iops set to zero (#3601)
1 parent 93f131c commit a8fbf28

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

clusters/resource_cluster.go

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ const DefaultProvisionTimeout = 30 * time.Minute
2020
const DbfsDeprecationWarning = "For init scripts use 'volumes', 'workspace' or cloud storage location instead of 'dbfs'."
2121

2222
var clusterSchema = resourceClusterSchema()
23-
var clusterSchemaVersion = 3
23+
var clusterSchemaVersion = 4
2424

2525
const (
2626
numWorkerErr = "NumWorkers could be 0 only for SingleNode clusters. See https://docs.databricks.com/clusters/single-node.html for more details"
@@ -39,7 +39,7 @@ func ResourceCluster() common.Resource {
3939
StateUpgraders: []schema.StateUpgrader{
4040
{
4141
Type: clusterSchemaV0(),
42-
Version: 2,
42+
Version: 3,
4343
Upgrade: removeZeroAwsEbsVolumeAttributes,
4444
},
4545
},
@@ -65,6 +65,10 @@ func removeZeroAwsEbsVolumeAttributes(ctx context.Context, rawState map[string]i
6565
log.Printf("[INFO] remove zero ebs_volume_count")
6666
delete(awsAttributes, "ebs_volume_count")
6767
}
68+
if awsAttributes["ebs_volume_iops"] == 0 {
69+
log.Printf("[INFO] remove zero ebs_volume_iops")
70+
delete(awsAttributes, "ebs_volume_iops")
71+
}
6872
if awsAttributes["ebs_volume_size"] == 0 {
6973
log.Printf("[INFO] remove zero ebs_volume_size")
7074
delete(awsAttributes, "ebs_volume_size")

0 commit comments

Comments
 (0)