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

Inconsistent plan #49

Open
alekc opened this issue Sep 19, 2023 · 1 comment
Open

Inconsistent plan #49

alekc opened this issue Sep 19, 2023 · 1 comment
Assignees
Labels
bug Something isn't working

Comments

@alekc
Copy link
Owner

alekc commented Sep 19, 2023

Following code throw an error

provider "kubectl" {}

provider "kubernetes" {
  config_path = "~/.kube/config"
}

resource "kubernetes_namespace" "test" {
  metadata {
    name = "terraform-test"
    labels = {
      "test" = formatdate("YYYYMMDDhhmmss", timestamp())
    }
  }
}

resource "kubectl_manifest" "secret" {
  yaml_body = <<-EOT
    apiVersion: v1
    kind: Secret
    metadata:
      name: test-secret
    stringData:
      var: "${kubernetes_namespace.test.metadata.0.resource_version}"
  EOT
  override_namespace = kubernetes_namespace.test.metadata.0.name
}

Fix from #46 has been partial
Error happens on third rerun

@alekc alekc self-assigned this Sep 19, 2023
@alekc alekc added the bug Something isn't working label Sep 19, 2023
@alekc
Copy link
Owner Author

alekc commented Sep 19, 2023

So, interestingly enough this:

provider "kubernetes" {
  config_path = "~/.kube/config"
}

resource "kubernetes_namespace" "test" {
  metadata {
    name   = "terraform-test"
    labels = {
      "test" = formatdate("YYYYMMDDhhmmss", timestamp())
    }
  }
}

resource "kubernetes_config_map" "xxx" {
  metadata {
    name = "xx"
  }
  data = {
    var = <<EOF
    ${kubernetes_namespace.test.metadata.0.resource_version}
EOF
  }
}

also fails with the same error. Makes me wonder if it's an edge case and if it should be treated or not.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant