Skip to content

Commit dcf0ffc

Browse files
Remove release channel UNSPECIFIED diff suppress (#4554) (#8595)
Signed-off-by: Modular Magician <magic-modules@google.com>
1 parent a0e9b81 commit dcf0ffc

File tree

3 files changed

+11
-6
lines changed

3 files changed

+11
-6
lines changed

.changelog/4554.txt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
```release-note:bug
2+
container: fixed an issue where release channel UNSPECIFIED could not be set
3+
```

google/resource_container_cluster.go

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -906,10 +906,9 @@ func resourceContainerCluster() *schema.Resource {
906906
Elem: &schema.Resource{
907907
Schema: map[string]*schema.Schema{
908908
"channel": {
909-
Type: schema.TypeString,
910-
Required: true,
911-
ValidateFunc: validation.StringInSlice([]string{"UNSPECIFIED", "RAPID", "REGULAR", "STABLE"}, false),
912-
DiffSuppressFunc: emptyOrDefaultStringSuppress("UNSPECIFIED"),
909+
Type: schema.TypeString,
910+
Required: true,
911+
ValidateFunc: validation.StringInSlice([]string{"UNSPECIFIED", "RAPID", "REGULAR", "STABLE"}, false),
913912
Description: `The selected release channel. Accepted values are:
914913
* UNSPECIFIED: Not set.
915914
* RAPID: Weekly upgrade cadence; Early testers and developers who requires new features.
@@ -2961,12 +2960,12 @@ func flattenVerticalPodAutoscaling(c *containerBeta.VerticalPodAutoscaling) []ma
29612960

29622961
func flattenReleaseChannel(c *containerBeta.ReleaseChannel) []map[string]interface{} {
29632962
result := []map[string]interface{}{}
2964-
if c != nil {
2963+
if c != nil && c.Channel != "" {
29652964
result = append(result, map[string]interface{}{
29662965
"channel": c.Channel,
29672966
})
29682967
} else {
2969-
// Explicitly set the release channel to the default.
2968+
// Explicitly set the release channel to the UNSPECIFIED.
29702969
result = append(result, map[string]interface{}{
29712970
"channel": "UNSPECIFIED",
29722971
})

google/resource_container_node_pool_test.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1005,6 +1005,9 @@ resource "google_container_cluster" "cluster" {
10051005
name = "%s"
10061006
location = "us-central1-a"
10071007
initial_node_count = 1
1008+
release_channel {
1009+
channel = "UNSPECIFIED"
1010+
}
10081011
}
10091012
10101013
resource "google_container_node_pool" "np_with_management" {

0 commit comments

Comments
 (0)