-
Notifications
You must be signed in to change notification settings - Fork 278
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
kubernetes - enable surge upgrades by default during cluster creation #584
kubernetes - enable surge upgrades by default during cluster creation #584
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
@@ -32,6 +32,7 @@ func dataSourceDigitalOceanKubernetesCluster() *schema.Resource { | |||
"surge_upgrade": { | |||
Type: schema.TypeBool, | |||
Computed: true, | |||
Default: true, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Data sources just report the state returned by the API for existing resources. You probably want to change the resource:
terraform-provider-digitalocean/digitalocean/resource_digitalocean_kubernetes_cluster.go
Line 49 in c1fb046
"surge_upgrade": { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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