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 resizing a node pool defined in google_container_cluster #331

Merged
merged 2 commits into from
Aug 18, 2017

Conversation

danawillow
Copy link
Contributor

Fixes #25.

@@ -236,10 +236,9 @@ func resourceContainerCluster() *schema.Resource {
ForceNew: true, // TODO(danawillow): Add ability to add/remove nodePools
Elem: &schema.Resource{
Schema: map[string]*schema.Schema{
"initial_node_count": {
Copy link
Contributor

Choose a reason for hiding this comment

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

Should we keep the old field and marked it as deprecated or removed? this way, we can show an error message to the user

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done.

}

log.Printf("[INFO] GKE node pool %s size has been updated to %d", npName, newSize)

Copy link
Contributor

Choose a reason for hiding this comment

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

nit: remove extra line.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done.


for i, np := range c {
// Node pools don't expose the current node count in their API, so read the
Copy link
Contributor

Choose a reason for hiding this comment

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

Have we talked with the GKE folks about updating their API to include the node count?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yup (I can show you the thread off-github)

nodeCount = initialNodeCount.(int)
}
if nc, ok := d.GetOk(prefix + ".node_count"); ok {
if nodeCount != 0 {
Copy link
Contributor

@rosbo rosbo Aug 17, 2017

Choose a reason for hiding this comment

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

Should we use ConflictsWith instead in the schema? This way, we bring the validation at the plan stage instead of apply?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

We can't, since it's a list

@danawillow danawillow merged commit 4cbc859 into hashicorp:master Aug 18, 2017
@danawillow danawillow deleted the is-25 branch August 18, 2017 00:52
@AndreaGiardini
Copy link

Can we have a new release including this fix? It would help us a lot! :)

negz pushed a commit to negz/terraform-provider-google that referenced this pull request Oct 17, 2017
…ter (hashicorp#331)

* Add support for resizing a node pool defined in google_container_cluster

* add initial node count back but make it deprecated
luis-silva pushed a commit to luis-silva/terraform-provider-google that referenced this pull request May 21, 2019
<!-- This change is generated by MagicModules. -->
/cc @chrisst
@ghost
Copy link

ghost commented Mar 30, 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 👉 [email protected]. Thanks!

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

Successfully merging this pull request may close these issues.

Resize google_container_cluster without destroying and re-creating
3 participants