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

Bogus use_ip_aliases state reported on upgrade to v3.7.0 #5586

Closed
akilman opened this issue Feb 4, 2020 · 4 comments · Fixed by GoogleCloudPlatform/magic-modules#3123, #5666 or hashicorp/terraform-provider-google-beta#1760
Assignees
Labels

Comments

@akilman
Copy link

akilman commented Feb 4, 2020

Community Note

  • Please vote on this issue by adding a 👍 reaction to the original issue to help the community and maintainers prioritize this request.
  • Please do not leave +1 or me too comments, they generate extra noise for issue followers and do not help prioritize the request.
  • If you are interested in working on this issue or have submitted a pull request, please leave a comment.
  • If an issue is assigned to the 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 Version

$ terraform -v
Terraform v0.12.20
+ provider.google v3.7.0
+ provider.kubernetes v1.10.0
+ provider.random v2.2.1

Affected Resource(s)

  • google_container_cluster

Terraform Configuration Files

resource "google_container_cluster" "clever-cluster-name" {
    name = "${var.application_instance_name}-cluster"
    depends_on = [google_project_service.kubernetes]

    remove_default_node_pool = true
    initial_node_count = 1

    ip_allocation_policy {
    }

    network = google_compute_network.clever-vpc.self_link
}

Debug Output

https://gist.github.com/akilman/f06c0d2a00f86ae2aeac0f3e37f34023

Panic Output

Expected Behavior

GCP reports useIpAliases == true in the UI after upgrade to v3.7.0 of the Google provider and terraform apply. Terraform should reflect the same correct state.

Actual Behavior

terraform show | grep ip_allocation_policy -A 8 details use_ip_aliases == false

Steps to Reproduce

  1. terraform apply w/ v2.5.0 Google Provider with
    ip_allocation_policy {
        use_ip_aliases = true
    }
  1. Upgrade to 3.7.0 provider, following the upgrade guide which instructs to remove use_ip_aliases = true as true is the default with the presence of the ip_allocation_policy
  2. terraform apply with newly upgraded Provider + updated config
  3. Observe use_ip_aliases has changed to false in Terraform. However, in GCP useIpAliases is still set to true. Can be confirmed via:
$ gcloud container clusters describe clever-cluster | grep useIpAliases

Important Factoids

References

@ghost ghost added the bug label Feb 4, 2020
@edwardmedia edwardmedia self-assigned this Feb 4, 2020
@akilman
Copy link
Author

akilman commented Feb 5, 2020

For good measure, attempted to spin up a fresh cluster to see if it was just a state reporting issue on upgrade. But, was able to reproduce the same behavior on a newly provisioned environment.

terraform show reports use_ip_aliases = false, and GCP's UI reports VPC native (Alias IP) attribute of the cluster is set to true 🤷‍♂

@edwardmedia
Copy link
Contributor

@c2thorn after tf init, I see this in the plan

      + ip_allocation_policy {
          + cluster_ipv4_cidr_block       = (known after apply)
          + cluster_secondary_range_name  = (known after apply)
          + create_subnetwork             = (known after apply)
          + node_ipv4_cidr_block          = (known after apply)
          + services_ipv4_cidr_block      = (known after apply)
          + services_secondary_range_name = (known after apply)
          + subnetwork_name               = (known after apply)
          + use_ip_aliases                = (known after apply)
        }

after tf apply I see this in the show (it is false)

    ip_allocation_policy {
        cluster_ipv4_cidr_block       = "10.4.0.0/14"
        cluster_secondary_range_name  = "gke-name-cluster-pods-432f38af"
        create_subnetwork             = false
        services_ipv4_cidr_block      = "10.0.0.0/20"
        services_secondary_range_name = "gke-name-cluster-services-432f38af"
        use_ip_aliases                = false
    }

In the meantime, GCP UI show

VPC-native (alias IP)	Enabled

@c2thorn
Copy link
Collaborator

c2thorn commented Feb 12, 2020

use_ip_aliases is a removed field since v3.0.0, so ideally it would not appear in state at all. Filed an issue with the Terraform SDK, but in the meantime I'll add a workaround for this field.

@ghost
Copy link

ghost commented Mar 28, 2020

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!

@ghost ghost locked and limited conversation to collaborators Mar 28, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.