diff --git a/bundle/config/mutator/compute_id_compat.go b/bundle/config/mutator/compute_id_compat.go index fb095d952..3afe02e9e 100644 --- a/bundle/config/mutator/compute_id_compat.go +++ b/bundle/config/mutator/compute_id_compat.go @@ -67,7 +67,12 @@ func rewriteComputeIdToClusterId(v dyn.Value, p dyn.Path) (dyn.Value, diag.Diagn // Drop the "compute_id" key. vout, err := dyn.Walk(nv, func(p dyn.Path, v dyn.Value) (dyn.Value, error) { switch len(p) { - case 0, 1: + case 0: + return v, nil + case 1: + if p[0] == dyn.Key("compute_id") { + return v, dyn.ErrDrop + } return v, nil case 2: if p[1] == dyn.Key("compute_id") { diff --git a/bundle/config/mutator/compute_id_compate_test.go b/bundle/config/mutator/compute_id_compate_test.go index ff051ac49..e59d37e39 100644 --- a/bundle/config/mutator/compute_id_compate_test.go +++ b/bundle/config/mutator/compute_id_compate_test.go @@ -41,8 +41,13 @@ func TestComputeIdToClusterIdInTargetOverride(t *testing.T) { }, } - diags := bundle.Apply(context.Background(), b, bundle.Seq(mutator.ComputeIdToClusterId(), mutator.SelectTarget("dev"))) + diags := bundle.Apply(context.Background(), b, mutator.ComputeIdToClusterId()) assert.NoError(t, diags.Error()) + assert.Empty(t, b.Config.Targets["dev"].ComputeId) + + diags = diags.Extend(bundle.Apply(context.Background(), b, mutator.SelectTarget("dev"))) + assert.NoError(t, diags.Error()) + assert.Equal(t, "compute-id-dev", b.Config.Bundle.ClusterId) assert.Empty(t, b.Config.Bundle.ComputeId) diff --git a/bundle/deploy/terraform/tfdyn/convert_cluster_test.go b/bundle/deploy/terraform/tfdyn/convert_cluster_test.go index 68872a421..e7d2542fd 100644 --- a/bundle/deploy/terraform/tfdyn/convert_cluster_test.go +++ b/bundle/deploy/terraform/tfdyn/convert_cluster_test.go @@ -71,6 +71,7 @@ func TestConvertCluster(t *testing.T) { "availability": "SPOT", }, "data_security_mode": "USER_ISOLATION", + "no_wait": true, "node_type_id": "m5.xlarge", "autoscale": map[string]any{ "min_workers": int64(1),