Skip to content
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

update_policy do not allow "NONE" anymore #4921

Closed
arsiesys opened this issue Nov 15, 2019 · 2 comments · Fixed by GoogleCloudPlatform/magic-modules#2706
Closed

update_policy do not allow "NONE" anymore #4921

arsiesys opened this issue Nov 15, 2019 · 2 comments · Fixed by GoogleCloudPlatform/magic-modules#2706
Assignees
Milestone

Comments

@arsiesys
Copy link

arsiesys commented Nov 15, 2019

Community Note

  • Please vote on this issue by adding a 👍 reaction to the original issue to help the community and maintainers prioritize this request
  • Please do not leave "+1" or "me too" comments, they generate extra noise for issue followers and do not help prioritize the request
  • If you are interested in working on this issue or have submitted a pull request, please leave a comment
  • If an issue is assigned to the "modular-magician" user, it is either in the process of being autogenerated, or is planned to be autogenerated soon. If an issue is assigned to a user, that user is claiming responsibility for the issue. If an issue is assigned to "hashibot", a community member has claimed the issue already.

Description

Hello, the new google-provider 3.0 release include a change about "upgrade_strategy" moved to "update_policy". However, we are not able to use "NONE" anymore.

Only REPLACE and RESTART are now allowed:
https://github.com/terraform-providers/terraform-provider-google/blob/8f21d20d5fe3d545bc171745b7dc17e43c827540/google/resource_compute_instance_group_manager.go#L198

If I make a "plan" after removing the update_strategy = "NONE" with 3.0, terraform seems to try to add the minimual_action = replace based the on the terraform plan output :

  # google_compute_instance_group_manager.k8s-node[2] will be updated in-place
  ~ resource "google_compute_instance_group_manager" "k8s-node" {
        base_instance_name = "k8s-node"
        fingerprint        = "xxx"
        id                 = "xxxx"
        instance_group     = "xxx"
        instance_template  = "xxx"
        name               = "xxxx"
        project            = "xxxx"
        self_link          = "xxxx"
        target_pools       = []
        target_size        = 0
      ~ update_strategy    = "NONE" -> "REPLACE"
        wait_for_instances = false
        zone               = "northamerica-northeast1-c"

        named_port {
            name = "ingress"
            port = 32177
        }

        timeouts {}

        update_policy {
            max_surge_fixed         = 1
            max_surge_percent       = 0
            max_unavailable_fixed   = 1
            max_unavailable_percent = 0
            min_ready_sec           = 0
            minimal_action          = "REPLACE"
            type                    = "OPPORTUNISTIC"
        }

        version {
            instance_template = "xxx"
        }
    }```

### New or Affected Resource(s)

- google_compute_instance_group_manager



@danawillow danawillow added this to the 3.0.0 milestone Nov 15, 2019
@chrisst
Copy link
Contributor

chrisst commented Nov 16, 2019

@arsiesys there's a few different things in your request so I'll start with some background for the change: update_strategy isn't part of the API and was something that we had bolted on to the resource because that functionality wasn't available in the API yet. Since then the API has now added the ability to declaratively manage version updates 🎉 This change pushes the management of restarting/replacing the instances to instance group instead of Terraform managing the restart process. update_policy now replaces all the functionality that update_strategy did but across several different configurable options.

Previously the NONE tag just didn't make any extra calls to the compute instances whereas the REPLACE/RESTART iterated through all the instances manually calling recreateInstance on each. To replicate the same behavior as NONE you can set the update_policy to minimal_action = RESTART and type = OPPORTUNISTIC. I'll add more details to the upgrade guide to this effect.

Secondly the diff you are seeing is definitely a bit misleading. It is a side effect of the field being optional with a default that I didn't anticipate. I'll fix this before 3.0.0 officially ships so that it doesn't show up.

Finally thank you for this feedback, getting this fixed before the full 3.0.0 release is a big help for all other users.

@ghost
Copy link

ghost commented Dec 19, 2019

I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues.

If you feel this issue should be reopened, we encourage creating a new issue linking back to this one for added context. If you feel I made an error 🤖 🙉 , please reach out to my human friends 👉 [email protected]. Thanks!

@ghost ghost locked and limited conversation to collaborators Dec 19, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants