Skip to content

Commit

Permalink
Remove release channel UNSPECIFIED diff suppress (#4554) (#8595)
Browse files Browse the repository at this point in the history
Signed-off-by: Modular Magician <[email protected]>
  • Loading branch information
modular-magician authored Mar 3, 2021
1 parent a0e9b81 commit dcf0ffc
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 6 deletions.
3 changes: 3 additions & 0 deletions .changelog/4554.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
```release-note:bug
container: fixed an issue where release channel UNSPECIFIED could not be set
```
11 changes: 5 additions & 6 deletions google/resource_container_cluster.go
Original file line number Diff line number Diff line change
Expand Up @@ -906,10 +906,9 @@ func resourceContainerCluster() *schema.Resource {
Elem: &schema.Resource{
Schema: map[string]*schema.Schema{
"channel": {
Type: schema.TypeString,
Required: true,
ValidateFunc: validation.StringInSlice([]string{"UNSPECIFIED", "RAPID", "REGULAR", "STABLE"}, false),
DiffSuppressFunc: emptyOrDefaultStringSuppress("UNSPECIFIED"),
Type: schema.TypeString,
Required: true,
ValidateFunc: validation.StringInSlice([]string{"UNSPECIFIED", "RAPID", "REGULAR", "STABLE"}, false),
Description: `The selected release channel. Accepted values are:
* UNSPECIFIED: Not set.
* RAPID: Weekly upgrade cadence; Early testers and developers who requires new features.
Expand Down Expand Up @@ -2961,12 +2960,12 @@ func flattenVerticalPodAutoscaling(c *containerBeta.VerticalPodAutoscaling) []ma

func flattenReleaseChannel(c *containerBeta.ReleaseChannel) []map[string]interface{} {
result := []map[string]interface{}{}
if c != nil {
if c != nil && c.Channel != "" {
result = append(result, map[string]interface{}{
"channel": c.Channel,
})
} else {
// Explicitly set the release channel to the default.
// Explicitly set the release channel to the UNSPECIFIED.
result = append(result, map[string]interface{}{
"channel": "UNSPECIFIED",
})
Expand Down
3 changes: 3 additions & 0 deletions google/resource_container_node_pool_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -1005,6 +1005,9 @@ resource "google_container_cluster" "cluster" {
name = "%s"
location = "us-central1-a"
initial_node_count = 1
release_channel {
channel = "UNSPECIFIED"
}
}
resource "google_container_node_pool" "np_with_management" {
Expand Down

0 comments on commit dcf0ffc

Please sign in to comment.