modular-magician user, it is either in the process of being autogenerated, or is planned to be autogenerated soon. If an issue is assigned to a user, that user is claiming responsibility for the issue. If an issue is assigned to hashibot, a community member has claimed the issue already.Terraform v0.12.20
+ provider.google v3.7.0
resource "google_container_cluster" "default" {
...
# First create a cluster without resource_labels set, then re-apply after setting a label
resource_labels = {
key = "value"
}
}
https://gist.github.com/chrisob/52250906dc38c6f300673033a60c26a1
TF should be able to update a GKE cluster's resource_labels on the fly.
Because the request body doesn't include the field labelFingerprint, TF gets a 400 error back from GCP complaining that:
Error: googleapi: Error 400: Labels could not be set due to fingerprint mismatch; try again with the proper fingerprint: incorrect fingerprint supplied was "", the expected one is "a9dc16a7"., failedPrecondition
terraform apply to create a google_container_cluster without any resource_labels set.resource_labels to the google_container_cluster, and attempt another terraform applyLooking at the API spec for setResourceLabels, it's pretty clear that the issue is the missing labelFingerprint field in the request body.
Relevant GCP API call: https://cloud.google.com/kubernetes-engine/docs/reference/rest/v1beta1/projects.locations.clusters/setResourceLabels
@c2thorn I see the same problem. Debug.log is the same (above). In the plan I do see
~ resource_labels = {
+ "key" = "value"
}
The same issue affects terraform-provider-google-beta (v2.18.1 in my case).
Thanks for contributing @eadred! Merged in your changes. If you ever want to contribute in the future, the easiest way is to make a change in our Magic Modules repo like so: https://github.com/GoogleCloudPlatform/magic-modules/pull/3128. That way it will make the same change to both providers.
Either way, thanks a ton for helping out!
Hey guys,
Is this issue supposed to be fixed already?
I am stucked because of that atm. Any advices?
Terraform v0.12.20
+ provider.google v3.8.0
+ provider.google-beta v3.8.0
The fixes didn't make it into v3.8.0 - presumably the next release will have them.
v3.9.0 was cut before the change went in. The fix should be available in v3.10.0 which should be released around 2/24.
If needed sooner, you can always build directly from the master branch.
Any chance we can get a v2.20+ that includes this fix? It looks like both branches were patched, we just need a release if I'm reading correctly.
The fix only went into HEAD, but you should be able to fork and cherry pick the fix onto v2.20. It worked OK without any changes on v2.18.
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!
Most helpful comment
v3.9.0 was cut before the change went in. The fix should be available in v3.10.0 which should be released around 2/24.
If needed sooner, you can always build directly from the master branch.