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

Goggle compute API beta->v1 change keeps triggering a TF diff with 1.13.0 #1610

Closed
czka opened this issue Jun 7, 2018 · 8 comments
Closed
Labels

Comments

@czka
Copy link

czka commented Jun 7, 2018

$ terraform version
Terraform v0.11.7
+ provider.google v1.13.0

terraform plan with provider.google v1.10.0 reports no changes on terraform plan. After upgrading to v1.13.0, terraform plan keeps reporting the change quoted below, even though I did run terraform apply on it in advance.

An execution plan has been generated and is shown below.
Resource actions are indicated with the following symbols:
  ~ update in-place

Terraform will perform the following actions:

  ~ google_compute_instance.machine1
      network_interface.#:                    "1" => "1"
      network_interface.0.address:            "10.118.234.33" => <computed>
      network_interface.0.name:               "nic0" => <computed>
      network_interface.0.network_ip:         "10.118.234.33" => <computed>
      network_interface.0.subnetwork:         
"https://www.googleapis.com/compute/beta/projects/project1/regions/us-east4/subnetworks/subnet1" => 
"https://www.googleapis.com/compute/v1/projects/project1/regions/us-east4/subnetworks/subnet1"
      network_interface.0.subnetwork_project: "project1" => <computed>


Plan: 0 to add, 1 to change, 0 to destroy.
@rosbo rosbo added the bug label Jun 7, 2018
@rosbo
Copy link
Contributor

rosbo commented Jun 7, 2018

Hi, I cannot reproduce this issue.

I tried pinning the version to 1.10.0 and then upgrading to 1.13.0 and still see no diff.

In the output you posted, did you copy integrally the stuff below ~ google_compute_instance.machine1? Because there is no diff in the network_interface. When looking at it, one could think the diff comes from the subnetwork field but it does not. There is a function that suppress the diff between v1 and beta self link on the subnetwork field and since the subnetwork field is ForceNew, a diff would create a Create/Delete diff and not an in-place update. The output would look like that:

network_interface.0.subnetwork:         "https://www.googleapis.com/compute/beta/projects/xxx/regions/us-east1/subnetworks/default" => "https://www.googleapis.com/compute/v1/projects/xxx/regions/us-west1/subnetworks/default" (forces new resource)

Do you think you could share your debug logs please?

@rosbo
Copy link
Contributor

rosbo commented Jun 7, 2018

This issue is also related to #988 where we have a perm diff when there should be no diff. We are investigating it.

@danawillow
Copy link
Contributor

@czka, mind sharing your config? Are you using lifecycle.ignore_changes by any chance?

@czka
Copy link
Author

czka commented Jun 8, 2018

@danawillow This particular node has ignore_changes = ["metadata_startup_script", "boot_disk.0.initialize_params.0.image", "boot_disk.0.device_name" only. Nothing else is being ignored all over the TF resources which are processed during the terraform plan. I can't share my config. It's top secret production stuff :).

@rosbo After switching from 1.10.0 to 1.13.0 I'm only getting a diff for google_compute_instance (a number of them; this one I'm quoting here is just one example). TF doesn't return diff for any other resources.

@rosbo
Copy link
Contributor

rosbo commented Jun 8, 2018

@danawillow found a bug in Terraform Core which is causing ForceNew field with a DiffSuppressFunc to not behave properly when there is a 'suppressable' diff. See for more details: hashicorp/terraform#18209

While waiting for the Terraform Core to be fixed, we can cheat a bit by converting the subnetwork self_link to v1 before we store it in the state. I will open a PR soon

@rosbo
Copy link
Contributor

rosbo commented Jun 8, 2018

I will keep this issue open until hashicorp/terraform#18209 is merged

@rosbo
Copy link
Contributor

rosbo commented Jun 8, 2018

Actually, this specific issue with beta links is resolved with the latest fix merged. We will keep #988 open to track the real root cause of this issue. Closing

@rosbo rosbo closed this as completed Jun 8, 2018
@ghost
Copy link

ghost commented Nov 18, 2018

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 Nov 18, 2018
@ghost ghost locked and limited conversation to collaborators Nov 18, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

3 participants