hashicorp / terraform-provider-kubernetes

Terraform Kubernetes provider

Home Page:https://www.terraform.io/docs/providers/kubernetes/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Use CustomizeDiff to prevent incomprehensible env vars diffs

willstott101 opened this issue · comments

Description

It's possible for adding/removing/re-ordering of environment variables in containers to result in spurious or overly-complex diffs in a terraform plan.

Something like this seems like a no-op from a containers PoV:

                      ~ env {
                          ~ name  = "DJANGO_DEBUG" -> "EXPECTED_HOST"
                          ~ value = "no" -> "my.host"
                        }
                      ~ env {
                          ~ name  = "EXPECTED_HOST" -> "DJANGO_DEBUG"
                          ~ value = "my.host" -> "no"
                        }

This is in a kubernetes_deployment.spec.template.spec.container.env

References

terraform docs: https://developer.hashicorp.com/terraform/plugin/sdkv2/resources/customizing-differences

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

Thanks for opening this issue @willstott101. Does this diff happen immediately after creating the resource, or only if you make some changes to the ordering afterwards?

I believe the diff is stable, it's only if we've made some sort of change that the diff is hard to understand.