-
Notifications
You must be signed in to change notification settings - Fork 264
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
Allow updating workload identity in GKE clusters without force create #896
Allow updating workload identity in GKE clusters without force create #896
Conversation
👍 I completely agree. I am not sure why terraform was behaving differently... |
The reason we didn't add support for updating initially is that Terraform runs into a bit of a problem with the
While we could have Terraform update the value on node pools in the cluster, that would be overreaching what it says it would do in Alternatively, we could attempt the update and fail if it's impossible. That's what this PR does, I think. I anticipate this being frustrating for users because updating I'll play around with the API to refresh myself on how it behaves, and verify what I said here. |
The reason why I want this is recreating cluster loses all the deployments and would add up to the downtime and overhead. I would be happy to do any changes to make the user experience better. |
Just a brief status update- I'm verifying that what I said about the behaviour of updates is correct. I was out yesterday, but should loop back here by EOD. If not, I will on Monday. Edit: I looked at this briefly during the week, but didn't end up finishing. I should be able to get to it next week, though. |
Hey @rileykarson, |
Sorry this took so long! I ran into some issues with Terraform partial updates when attempting this initially, and then some other work kept pulling me off. So, this works when turning on Workload Identity and enabling the new value on node pools. It won't work when turning it off though, as Terraform will update the cluster before attempting to update the node pool. Unfortunately, Terraform is single-pass so it can't handle these cases well. We'll need to note that users need to explicitly use another value on all node pools in the docs under the In addition, I'd like to add a test for update. Can you change the value in https://github.com/terraform-providers/terraform-provider-google-beta/blob/master/google-beta/resource_container_cluster_test.go#L738-L762? https://github.com/terraform-providers/terraform-provider-google-beta/blob/master/google-beta/resource_container_cluster_test.go#L564-L600 is an example testing update, you'll see that there are multiple configs. I sent a PR to your fork (it should be linked in GH below) that adds some massaging necessary for disablement. If you merge that, it'll show up as part of the changes here as well. Sorry for the extensive patch! I was playing around with changing the value in clusters, and ended up making a handful of changes on top of your branch to test it out. |
@rileykarson Thanks for the PR, I have merged it. |
@rileykarson It seems gcloud api is not accepting empty value for |
Hmm- can you share the config you're testing with? It's possible that we've specified the removal of the namespace differently. I'd alternated between these:
|
@rileykarson Thanks for sharing the config, I figured out the issue. I was trying to set |
Hey @rileykarson, |
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.
Sorry about that! I didn't notice the notification for the code push. LGTM!
I'll upstream this to our code generator to make sure the change can easily be applied to the google
provider when the feature goes GA, and merge this once it's been staged there.
Actually, looks like the test file has been updated. Do you mind rebasing / merging the branch so there are no conflicts? |
254eab1
to
4dc21b2
Compare
Since gcloud allows updating workload identity from console and sdk without recreating the cluster, terraform also should not force recreation.
4dc21b2
to
275b903
Compare
@rileykarson Thanks for the review! Rebased and squashed the commits. |
Since gcloud allows updating workload identity from console and sdk without recreating the cluster, terraform also should not force recreation.
I have tested it locally with this change, it worked fine for me without recreating the cluster.