kubernetes - enable surge upgrades by default during cluster creation#584
Conversation
andrewsomething
left a comment
There was a problem hiding this comment.
Unfortunately, changing the default for a non-required attribute can be intrusive. Unless a user has explicitly set surge_upgrade in their configuration, they will be prompted to apply changes to existing clusters. E.g.
An execution plan has been generated and is shown below.
Resource actions are indicated with the following symbols:
~ update in-place
Terraform will perform the following actions:
# digitalocean_kubernetes_cluster.foo will be updated in-place
~ resource "digitalocean_kubernetes_cluster" "foo" {
id = "21ea2185-bc6d-4a64-8797-e7898bc57d2f"
name = "foo"
~ An execution plan has been generated and is shown below.
Resource actions are indicated with the following symbols:
~ update in-place
Terraform will perform the following actions:
# digitalocean_kubernetes_cluster.foo will be updated in-place
~ resource "digitalocean_kubernetes_cluster" "foo" {
id = "21ea2185-bc6d-4a64-8797-e7898bc57d2f"
name = "foo"
~ surge_upgrade = false -> true
tags = []
# (12 unchanged attributes hidden)
# (1 unchanged block hidden)
}
Plan: 0 to add, 1 to change, 0 to destroy.-> true
tags = []
# (12 unchanged attributes hidden)
# (1 unchanged block hidden)
}
Plan: 0 to add, 1 to change, 0 to destroy.
The user can add surge_upgrade = false explicitly to prevent the diff.
I'm not necessarily opposed to the change if we think surge upgrades will provide a better user experience in the long run, but want to make the consequences of the change clear.
| "surge_upgrade": { | ||
| Type: schema.TypeBool, | ||
| Computed: true, | ||
| Default: true, |
There was a problem hiding this comment.
Data sources just report the state returned by the API for existing resources. You probably want to change the resource:
There was a problem hiding this comment.
@andrewsomething - I'm not sure if I should change the schema version if I just provide a default value. I have done so. But, let me know if that's necessary.
There was a problem hiding this comment.
Generally it's not needed unless you are doing a state migration, but there is no problem with bumping it.
https://www.terraform.io/docs/extend/resources/state-migration.html
dcb2595 to
764fe19
Compare
…#584) Co-authored-by: Andrew Starr-Bochicchio <andrewsomething@users.noreply.github.com>
Description: Now that surge upgrades is stable, enable surge upgrades by default as it is a better user experience during upgrades.
cc @adamwg