-
Notifications
You must be signed in to change notification settings - Fork 1.7k
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
Perma-diff when using self_link for network or subnetwork in google_container_cluster #1382
Comments
As you identified, it looks like we're storing the name of the network/subnetwork, but you're specifying a self_link. As a workaround, specifying the name should make this go away. A real solution would probably be to either validate this and throw an error if it's not just a name, accept a name or a self_link, or suppress the diff if a self_link is for a resource with the right name. |
We already have a All the other APIs return a self-link for the subnetwork and network field except the GKE API. In the d.Set("network", cluster.Network) // wrong. Unlike other APIs. cluster.Network is the name-only.
d.Set("subnetwork", cluster.Subnetwork) // same |
I have feelings about changing this on people mid-major-version, because it's technically a breaking change, though one could argue it probably doesn't matter. But this would change the value returned for every interpolation of network or subnetwork, which seems like a value you'd want to interpolate? I'm not saying let's leave it weird, but would it seems like we could work around it for the moment, and put it on the list for changes to make in 2.0.0 to address it at the root. /2¢ |
Fixed as part of #1528 |
Hi, Not sure if I need to open a new issue or use this one...
I'm using datasources to retrieve My 2¢: I saw you use relative links so it nether works with Thanks :) |
I am having this issue with the following attributes: |
Hi @duxbuse, I'm not sure that's an issue related to this one. Do you mind opening a new issue and filling out the issue template? We'll need a bunch more information before we can help you with that, unfortunately. |
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! |
This issue was originally opened by @nikitashalnov as hashicorp/terraform#17919. It was migrated here as a result of the provider split. The original body of the issue is below.
Terraform Version
Terraform Configuration Files
Expected Behavior
terraform plan
should show the plan, thenterraform apply
should this plan apply. After that running a commandterraform plan
on the SAME configuration files should show "No changes. Infrastructure is up-to-date."Actual Behavior
terraform plan
shows actual plan:terraform apply
applies the plan:terrafrom plan
again on the SAME configuration shows that it must recreate cluster:So terraform after creating GKE cluster misses some properties (id, subnet) and wants to recreate the cluster, because it thinks that something has changed.
Steps to Reproduce
terraform init
terraform apply
terraform plan
Additional Context
During to experiments how to work around this bug it was detected that the cause is in referencing to properties
network
andsubnetwork
of gke cluster byself_links
. Referencing byname
fixes this wrong behavior. So this configuration works fine:The text was updated successfully, but these errors were encountered: