Skip to content

Commit ea63e3c

Browse files
committed
2 parents 1d8e064 + b909e3f commit ea63e3c

2 files changed

Lines changed: 19 additions & 2 deletions

File tree

mmv1/third_party/terraform/services/compute/resource_compute_rollout_plan_test.go renamed to mmv1/third_party/terraform/services/compute/resource_compute_rollout_plan_test.go.tmpl

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
package compute_test
22

3+
{{- if ne $.TargetVersionName "ga" }}
4+
35
import (
46
"fmt"
57
"github.com/hashicorp/terraform-plugin-testing/helper/resource"
@@ -127,3 +129,5 @@ resource "google_compute_rollout_plan" "complex" {
127129
}
128130
`, context["random_suffix"])
129131
}
132+
133+
{{- end }}

mmv1/third_party/terraform/services/container/resource_container_cluster.go.tmpl

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2361,8 +2361,9 @@ func ResourceContainerCluster() *schema.Resource {
23612361
"state": {
23622362
Type: schema.TypeString,
23632363
Required: true,
2364-
ValidateFunc: validation.StringInSlice([]string{"ENCRYPTED", "DECRYPTED"}, false),
2365-
Description: `ENCRYPTED or DECRYPTED.`,
2364+
ValidateFunc: validation.StringInSlice([]string{"ENCRYPTED", "ALL_OBJECTS_ENCRYPTION_ENABLED", "DECRYPTED"}, false),
2365+
Description: `ENCRYPTED, ALL_OBJECTS_ENCRYPTION_ENABLED or DECRYPTED.`,
2366+
DiffSuppressFunc: DatabaseEncryptionSuppress,
23662367
},
23672368
"key_name": {
23682369
Type: schema.TypeString,
@@ -8832,6 +8833,18 @@ func SecretManagerCfgSuppress(k, old, new string, r *schema.ResourceData) bool {
88328833
return false
88338834
}
88348835

8836+
func DatabaseEncryptionSuppress(k, old, new string, d *schema.ResourceData) bool {
8837+
// The API sometimes returns ALL_OBJECTS_ENCRYPTION_ENABLED when the user sets ENCRYPTED
8838+
// and vice versa (depending on the cluster version and underlying resource storage).
8839+
if old == "ALL_OBJECTS_ENCRYPTION_ENABLED" && new == "ENCRYPTED" {
8840+
return true
8841+
}
8842+
if old == "ENCRYPTED" && new == "ALL_OBJECTS_ENCRYPTION_ENABLED" {
8843+
return true
8844+
}
8845+
return false
8846+
}
8847+
88358848
{{ if ne $.TargetVersionName `ga` -}}
88368849
func SecretSyncCfgSuppress(k, old, new string, r *schema.ResourceData) bool {
88378850
if k == "secret_sync_config.#" && old == "1" && new == "0" {

0 commit comments

Comments
 (0)