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

Use CustomizeDiff to prevent incomprehensible env vars diffs #2460

Open
willstott101 opened this issue Apr 9, 2024 · 2 comments
Open

Use CustomizeDiff to prevent incomprehensible env vars diffs #2460

willstott101 opened this issue Apr 9, 2024 · 2 comments

Comments

@willstott101
Copy link

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
@jrhouston
Copy link
Contributor

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?

@willstott101
Copy link
Author

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants