Skip to content

Commit

Permalink
CDPCP-13575 Environments should be CCM enabled by default (#191)
Browse files Browse the repository at this point in the history
  • Loading branch information
daszabo authored Dec 16, 2024
1 parent b9158a2 commit 1237c1f
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 3 deletions.
10 changes: 7 additions & 3 deletions resources/datahub/converter_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -173,9 +173,13 @@ func TestFromModelToRequestTags(t *testing.T) {
input := awsDatahubResourceModel{Tags: tags}
got := fromModelToAwsRequest(input, context.TODO())

test.CompareStrings(*got.Tags[0].Value, input.Tags.Elements()["key1"].(types.String).ValueString(), t)
test.CompareStrings(*got.Tags[1].Value, input.Tags.Elements()["key2"].(types.String).ValueString(), t)
test.CompareStrings(*got.Tags[2].Value, input.Tags.Elements()["key3"].(types.String).ValueString(), t)
expectedKeys := [3]string{"key1", "key2", "key1"}
gotKeys := [3]string{*got.Tags[0].Key, *got.Tags[1].Key, *got.Tags[2].Key}
test.CompareInts(len(got.Tags), 3, t)
test.CompareStringSlices(gotKeys[:], expectedKeys[:])
test.CompareStrings(*got.Tags[0].Value, input.Tags.Elements()[*got.Tags[0].Key].(types.String).ValueString(), t)
test.CompareStrings(*got.Tags[1].Value, input.Tags.Elements()[*got.Tags[1].Key].(types.String).ValueString(), t)
test.CompareStrings(*got.Tags[2].Value, input.Tags.Elements()[*got.Tags[2].Key].(types.String).ValueString(), t)
}

func TestFromModelToGcpRequestBasicFields(t *testing.T) {
Expand Down
1 change: 1 addition & 0 deletions resources/environments/schema_aws_environment.go
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,7 @@ var AwsEnvironmentSchema = schema.Schema{
"enable_tunnel": schema.BoolAttribute{
Optional: true,
Computed: true,
Default: booldefault.StaticBool(true),
PlanModifiers: []planmodifier.Bool{
boolplanmodifier.UseStateForUnknown(),
},
Expand Down
1 change: 1 addition & 0 deletions resources/environments/schema_azure_environment.go
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,7 @@ var AzureEnvironmentSchema = schema.Schema{
"enable_tunnel": schema.BoolAttribute{
Optional: true,
Computed: true,
Default: booldefault.StaticBool(true),
PlanModifiers: []planmodifier.Bool{
boolplanmodifier.UseStateForUnknown(),
},
Expand Down
1 change: 1 addition & 0 deletions resources/environments/schema_gcp_environment.go
Original file line number Diff line number Diff line change
Expand Up @@ -156,6 +156,7 @@ func (r *gcpEnvironmentResource) Schema(_ context.Context, _ resource.SchemaRequ
MarkdownDescription: "Whether to enable SSH tunneling for the environment.",
Optional: true,
Computed: true,
Default: booldefault.StaticBool(true),
PlanModifiers: []planmodifier.Bool{
boolplanmodifier.UseStateForUnknown(),
},
Expand Down

0 comments on commit 1237c1f

Please sign in to comment.