-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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
Rolling update support for instance group manager #1137
Rolling update support for instance group manager #1137
Conversation
@ishashchuk I don't have any code feedback, I just wanted to thank you for tackling this (as we'll be early adopters of it, soon as it's merged). |
@paddycarver friendly reminder :) |
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.
I'm storing rolling_update_policy block locally, and not applying it to computeBeta.InstanceGroupManager. There is no way to make an update call for this block on the InstanceGroupManager. It is only updated when the patch call for the instances is made. That's the reason I'm storing it locally and only applying it on the update calls that are changing the instance template.
I like this... but I wonder, what happens if someone:
- creates the resource with
RESTART
- changes it to
ROLLING_UPDATE
- does an update
- changes it back to
RESTART
- does another update
In that case, would this code act correctly? It seems like it wouldn't send a PATCH
request to remove the strategy, but I might be off.
@@ -184,6 +241,12 @@ func resourceComputeInstanceGroupManagerCreate(d *schema.ResourceData, meta inte | |||
return err | |||
} | |||
|
|||
_, ok := d.GetOk("rolling_update_policy") |
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.
Nit: Seems like it'd be neater as part of the if block below.
@@ -380,6 +443,11 @@ func resourceComputeInstanceGroupManagerUpdate(d *schema.ResourceData, meta inte | |||
|
|||
d.Partial(true) | |||
|
|||
_, ok := d.GetOk("rolling_update_policy") |
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.
same comment - include in the if statement if possible.
@ndmckinley When resource is set to RESTART, |
Ah! That's quite nice, then, neat trick. I think (but am not 100% sure) that I'd like it to be set during |
@ndmckinley In UI, the values for Running |
Fair enough - can you add a comment to that effect? Just that and I'll be ready to merge. |
Should be good to go |
Perfect. I'm running the tests now, and I expect to merge in an hour or so assuming no problems. |
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 👉 hashibot-feedback@hashicorp.com. Thanks! |
Addresses 51
Supports beta functionality for rolling updates.
When rolling_update is selected as update_strategy, it requires "rolling_update_policy" block.
I'm storing rolling_update_policy block locally, and not applying it to computeBeta.InstanceGroupManager. There is no way to make an update call for this block on the InstanceGroupManager. It is only updated when the patch call for the instances is made. That's the reason I'm storing it locally and only applying it on the update calls that are changing the instance template. That allows us to change rolling_update_policy arguments post creating InstanceGroupManager and making sure that they will be applied at the next patch call.
Once I get feedback on this, I will add similar support to region_instance_group_manager