terraform-google-kubernetes-engine icon indicating copy to clipboard operation
terraform-google-kubernetes-engine copied to clipboard

Deprecation warning for workload_metadata_config parameter

Open wyardley opened this issue 4 years ago • 14 comments
trafficstars

I'm getting the following as permadrift with https://github.com/terraform-google-modules/terraform-google-kubernetes-engine/tree/master/modules/beta-private-cluster and Google provider v3.88.0:

~ resource "google_container_node_pool" "pools" {
[…]
   ~ node_config {
[…]
     ~ workload_metadata_config {
       - mode     = "GKE_METADATA" -> null

If I explicitly set node_metadata = "GKE_METADATA_SERVER", I get a deprecation warning about node_metadata being deprecated for mode, presumably from:

https://github.com/terraform-google-modules/terraform-google-kubernetes-engine/blob/660ddc9afc9ed8a308d9388a08eff3c36af551a0/modules/beta-private-cluster/cluster.tf#L234

Either way, I can “apply” the drift, but it shows up on the next plan / apply. Is there a way to avoid this?

wyardley avatar Oct 11 '21 22:10 wyardley

Permadiffs should be addressed at the provider. Please open a bug here: https://github.com/hashicorp/terraform-provider-google/issues

morgante avatar Oct 11 '21 22:10 morgante

@morgante won't the deprecation warning

│ Warning: Deprecated Attribute
│ 
│   with module.gke.google_container_cluster.primary,
│   on .terraform/modules/gke/modules/beta-private-cluster/cluster.tf line 227, in resource "google_container_cluster" "primary":
│  227:     node_config {
│ 
│ Deprecated in favor of mode.

be an issue in either case (esp. if the module is supporting both old and new versions of the provider)?

wyardley avatar Oct 11 '21 23:10 wyardley

Also wondering if I may be missing a setting needed for this to not register?

Oddly, a plan with the same provider version didn't seem to exhibit this issue a couple of hours ago when I updated to the latest provider versions 🤔

I did try pinning a version or two back of this module (as well as the provider), and neither seemed to fix it.

wyardley avatar Oct 11 '21 23:10 wyardley

Oh sorry, I missed the deprecation warning. Yes we should fix that.

Oddly, a plan with the same provider version didn't seem to exhibit this issue a couple of hours ago when I updated to the latest provider versions 🤔

My guess is the API behavior changed.

morgante avatar Oct 11 '21 23:10 morgante

My guess is the API behavior changed.

Oh, derp. yeah, I've seen that happen before Filed https://github.com/hashicorp/terraform-provider-google/issues/10300 with some debug output that may help them figure it out

wyardley avatar Oct 11 '21 23:10 wyardley

I forked the module localy and changed the deprecated node_metadata to node and to the value GKE_METADATA instead of the previous GKE_METADATA_SERVER and seems the error has gone

alexku7 avatar Oct 12 '21 18:10 alexku7

For anyone is interested, i had to pin the exact provider version in my terraform configuration like this to not having the plan drift

terraform {
  required_providers {
    google = {
      source  = "hashicorp/google"
      version = "3.78"
    }
    google-beta = {
      source  = "hashicorp/google-beta"
      version = "3.82"
    }
    kubernetes = {
      source  = "hashicorp/kubernetes"
      version = "1.13.4"
    }
  }
}

onimsha avatar Oct 13 '21 07:10 onimsha

FYI, regarding version pinning, I only needed to pin the google provider to the version prior to the latest, 3.87.0 in order to avoid these updates.

brandondtb avatar Oct 14 '21 21:10 brandondtb

Hrm. I tried pinning one version back and didn’t have any luck, but will try it again.

wyardley avatar Oct 14 '21 23:10 wyardley

3.87.0 worked for me too Also seems like hashicorp/terraform-provider-google#10300 submitted by @wyardley has been fixed so hopefully the next provider release will include the fix

FearlessHyena avatar Oct 25 '21 17:10 FearlessHyena

FYI, upgrading to 3.90.0 does indeed seem to resolve this issue, but now I'm getting a deprecation warning for basic auth. Reported here: terraform-google-modules/terraform-google-kubernetes-engine#1042

JCPistell avatar Nov 02 '21 17:11 JCPistell

The issue has been fixed in 3.90.1: https://github.com/hashicorp/terraform-provider-google/pull/10479

JCPistell avatar Nov 02 '21 20:11 JCPistell

using 3.90.1 gets another error: terraform-google-kubernetes-engine/issues/1045

mike-serchenia avatar Nov 02 '21 22:11 mike-serchenia

This is broken again in 4.0+

FalconerTC avatar May 24 '22 19:05 FalconerTC