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

Add support for node pool autoscaling #157

Merged
merged 4 commits into from
Jul 26, 2017
Merged

Conversation

danawillow
Copy link
Contributor

Fixes #44.

This is essentially the same code as hashicorp/terraform#12779, except I added the enabled attribute and support for update.

TF_ACC=1 go test ./google -v -run=TestAccContainerNodePool_autoscaling -timeout 120m
=== RUN   TestAccContainerNodePool_autoscaling
--- PASS: TestAccContainerNodePool_autoscaling (1056.29s)
PASS
ok  	github.com/terraform-providers/terraform-provider-google/google	1056.417s

Copy link
Contributor

@paddycarver paddycarver left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Minor comment about OOB changes to whether autoscaling is enabled or not.

@@ -129,10 +180,70 @@ func resourceContainerNodePoolRead(d *schema.ResourceData, meta interface{}) err

d.Set("name", nodePool.Name)
d.Set("initial_node_count", nodePool.InitialNodeCount)
if nodePool.Autoscaling != nil && nodePool.Autoscaling.Enabled {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How do we detect if autoscaling has been turned on out of band and needs to be switched back on?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah, that's a good point.

I went ahead and checked what the cloud console does- when you turn autoscaling off and then back on, you lose the min/max node count you had originally set. Based on that, I removed the enabled attribute so we can easily detect out-of-band changes (this way we don't need to differentiate between set to false and not set at all, although in retrospect maybe a DiffSuppressFn on the autoscaling attribute would work? not sure). Let me know what you think.

Copy link
Contributor

@paddycarver paddycarver left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, and tests pass.

@danawillow danawillow merged commit 42a898d into hashicorp:master Jul 26, 2017
@danawillow danawillow deleted the is-44 branch July 26, 2017 20:21
z1nkum pushed a commit to z1nkum/terraform-provider-google that referenced this pull request Aug 15, 2017
* add node pool autoscaling

* docs for node pool autoscaling

* remove enabled attribute

* remove enabled from docs
negz pushed a commit to negz/terraform-provider-google that referenced this pull request Oct 17, 2017
* add node pool autoscaling

* docs for node pool autoscaling

* remove enabled attribute

* remove enabled from docs
chrisst pushed a commit to chrisst/terraform-provider-google that referenced this pull request Nov 9, 2018
* add node pool autoscaling

* docs for node pool autoscaling

* remove enabled attribute

* remove enabled from docs
luis-silva pushed a commit to luis-silva/terraform-provider-google that referenced this pull request May 21, 2019
Add to state before we send the create call.
@ghost
Copy link

ghost commented Mar 31, 2020

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!

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

Successfully merging this pull request may close these issues.

[GKE] Support autoscaling
3 participants