-
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
Add support for resizing a node pool defined in google_container_cluster #331
Conversation
google/resource_container_cluster.go
Outdated
@@ -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": { |
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.
Should we keep the old field and marked it as deprecated or removed? this way, we can show an error message to the user
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.
Done.
google/resource_container_cluster.go
Outdated
} | ||
|
||
log.Printf("[INFO] GKE node pool %s size has been updated to %d", npName, newSize) | ||
|
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: remove extra line.
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.
Done.
|
||
for i, np := range c { | ||
// Node pools don't expose the current node count in their API, so read the |
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.
Have we talked with the GKE folks about updating their API to include the node count?
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.
Yup (I can show you the thread off-github)
nodeCount = initialNodeCount.(int) | ||
} | ||
if nc, ok := d.GetOk(prefix + ".node_count"); ok { | ||
if nodeCount != 0 { |
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.
Should we use ConflictsWith instead in the schema? This way, we bring the validation at the plan stage instead of apply?
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.
We can't, since it's a list
Can we have a new release including this fix? It would help us a lot! :) |
…ter (hashicorp#331) * Add support for resizing a node pool defined in google_container_cluster * add initial node count back but make it deprecated
<!-- This change is generated by MagicModules. --> /cc @chrisst
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! |
Fixes #25.