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

Terraform does not detect change when setting property in kubernetes_secret to emtpty string #1803

Closed
rychuhardy opened this issue Aug 11, 2022 · 2 comments

Comments

@rychuhardy
Copy link

Terraform Version, Provider Version and Kubernetes Version

Terraform version: v1.2.6
Kubernetes provider version: v2.12.1
Kubernetes version: 1.22.6

Affected Resource(s)

  • kubernetes_secret

Terraform Configuration Files

terraform {
  required_providers {
    kubernetes = {
      source = "hashicorp/kubernetes"
      version = "~> 2.12.1"
    }
  }
}

provider "kubernetes" {
  config_context = "test-k8s-admin"
  config_path = "~/.kube/config"
}

variable "DB_PASSWORD" {
  
}

resource "kubernetes_secret" "db_secret" {
  metadata {
    name = "db-secret"
  }

  data = {
    "PASSWORD" = var.DB_PASSWORD
  }
}

Debug Output

https://gist.github.com/rychuhardy/76f5b5fc41374dbf7f9279c327fa1fa4

Steps to Reproduce

  1. terraform init
  2. export TF_VAR_DB_PASSWORD="abc"
  3. terraform apply -auto-approve
  4. export TF_VAR_DB_PASSWORD=""
  5. terraform plan

Expected Behavior

Change to kubernetes_secret should be detected.

Actual Behavior

No changes. Your infrastructure matches the configuration.

Community Note

  • Please vote on this issue by adding a 👍 reaction to the original issue to help the community and maintainers prioritize this request
  • If you are interested in working on this issue or have submitted a pull request, please leave a comment
@arybolovlev
Copy link
Contributor

arybolovlev commented Aug 24, 2022

Hi @rychuhardy,

Thank you for reporting this issue. That happens but to the following issue with the Terraform SDK: hashicorp/terraform-plugin-sdk#282

Unfortunately, there is not much we can do at the moment until the SDK team address the issue.

@github-actions
Copy link

Marking this issue as stale due to inactivity. If this issue receives no comments in the next 30 days it will automatically be closed. If this issue was automatically closed and you feel this issue should be reopened, we encourage creating a new issue linking back to this one for added context. This helps our maintainers find and focus on the active issues. Maintainers may also remove the stale label at their discretion. Thank you!

@github-actions github-actions bot added the stale label Aug 31, 2023
@github-actions github-actions bot closed this as not planned Won't fix, can't repro, duplicate, stale Sep 30, 2023
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Sep 29, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants