Skip to content

Set a default value for envs in Cloud Run Job #9681

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

Conversation

modular-magician
Copy link
Collaborator

What?

Why?

  • Currently, when a new env variable is added to the env set, the env set is re-ordered which results in a large diff, see Cloud Run env variables reordering causing resource to update in-place terraform-provider-google#7467 for an example. The cause for this seems to be that in the Terraform state the env value is "" when using a value_source (i.e. a reference to a google_secret_manager_secret), but in the plan the value is nil (as it has not been set), which then triggers all of the envs to have changed.

Release Note Template for Downstream PRs (will be copied)

See Write release notes for guidance.

cloudrunv2: fixed the diffs for unchanged `template.template.containers.env` in `google_cloud_run_v2_job` resource

Derived from GoogleCloudPlatform/magic-modules#13487

[upstream:e86e484d9bb1d72b351fde4f92ebfebb374e6b26]

Signed-off-by: Modular Magician <[email protected]>
@modular-magician modular-magician requested a review from a team as a code owner March 28, 2025 21:53
@modular-magician modular-magician merged commit df8cf12 into hashicorp:main Mar 28, 2025
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
1 participant