Skip to content

kubernetes - enable surge upgrades by default during cluster creation#584

Merged
andrewsomething merged 2 commits intodigitalocean:mainfrom
varshavaradarajan:varsha/enable-surge-upgrades-by-default
Feb 19, 2021
Merged

kubernetes - enable surge upgrades by default during cluster creation#584
andrewsomething merged 2 commits intodigitalocean:mainfrom
varshavaradarajan:varsha/enable-surge-upgrades-by-default

Conversation

@varshavaradarajan
Copy link
Copy Markdown
Contributor

Description: Now that surge upgrades is stable, enable surge upgrades by default as it is a better user experience during upgrades.

cc @adamwg

Copy link
Copy Markdown
Member

@andrewsomething andrewsomething left a 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.

"surge_upgrade": {
Type: schema.TypeBool,
Computed: true,
Default: true,
Copy link
Copy Markdown
Member

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:

Copy link
Copy Markdown
Contributor Author

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.

Copy link
Copy Markdown
Member

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

@varshavaradarajan varshavaradarajan force-pushed the varsha/enable-surge-upgrades-by-default branch from dcb2595 to 764fe19 Compare February 17, 2021 04:05
@andrewsomething andrewsomething merged commit 2642296 into digitalocean:main Feb 19, 2021
andrewsomething added a commit that referenced this pull request Apr 26, 2021
…#584)

Co-authored-by: Andrew Starr-Bochicchio <andrewsomething@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants