Skip to content

Add default value to env.value to fix the plan diffs in cloud run services #13363

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

Merged
merged 2 commits into from
Mar 18, 2025

Conversation

zli82016
Copy link
Member

@zli82016 zli82016 commented Mar 14, 2025

fixes b/240147716
fixes hashicorp/terraform-provider-google#7467
fixes hashicorp/terraform-provider-google#10634

This change will fix the diffs for unchanged env. env is a set. The env.value has value "" in Terraform state, but it has value nil in Terraform plan, which causes the diffs for unchanged env.

Release Note Template for Downstream PRs (will be copied)

See Write release notes for guidance.

cloudrun: fixed the perma-diffs for unchanged `template.spec.containers.env` in `google_cloud_run_service` resource
cloudrunv2: fixed the perma-diffs for unchanged `template.containers.env` in `google_cloud_run_v2_service` resource

@modular-magician
Copy link
Collaborator

Hi there, I'm the Modular magician. I've detected the following information about your changes:

Diff report

Your PR generated some diffs in downstreams - here they are.

google provider: Diff ( 2 files changed, 2 insertions(+))
google-beta provider: Diff ( 2 files changed, 2 insertions(+))

Breaking Change(s) Detected

The following breaking change(s) were detected within your pull request.

  • Field template.containers.env.value default value changed from to on google_cloud_run_v2_service - reference
  • Field template.spec.containers.env.value default value changed from to on google_cloud_run_service - reference

If you believe this detection to be incorrect please raise the concern with your reviewer.
If you intend to make this change you will need to wait for a major release window.
An override-breaking-change label can be added to allow merging.

@modular-magician modular-magician requested a review from zhruan March 14, 2025 23:51
@modular-magician
Copy link
Collaborator

Tests analytics

Total tests: 83
Passed tests: 72
Skipped tests: 11
Affected tests: 0

Click here to see the affected service packages
  • cloudrun
  • cloudrunv2

🟢 All tests passed!

View the build log

@zli82016 zli82016 marked this pull request as ready for review March 17, 2025 17:29
@zli82016 zli82016 added the override-breaking-change Allows a potential breaking change to be merged label Mar 17, 2025
@zli82016
Copy link
Member Author

zli82016 commented Mar 17, 2025

I tested the change locally that no diffs are shown for the unchanged env, but I don't find a way to test the fix in acceptance tests.

@zli82016 zli82016 requested a review from rileykarson March 17, 2025 20:13
@modular-magician
Copy link
Collaborator

Hi there, I'm the Modular magician. I've detected the following information about your changes:

Diff report

Your PR generated some diffs in downstreams - here they are.

google provider: Diff ( 2 files changed, 2 insertions(+))
google-beta provider: Diff ( 2 files changed, 2 insertions(+))

Breaking Change(s) Detected

The following breaking change(s) were detected within your pull request.

  • Field template.containers.env.value default value changed from to on google_cloud_run_v2_service - reference
  • Field template.spec.containers.env.value default value changed from to on google_cloud_run_service - reference

If you believe this detection to be incorrect please raise the concern with your reviewer.
If you intend to make this change you will need to wait for a major release window.
An override-breaking-change label can be added to allow merging.

@modular-magician
Copy link
Collaborator

Tests analytics

Total tests: 83
Passed tests: 72
Skipped tests: 11
Affected tests: 0

Click here to see the affected service packages
  • cloudrun
  • cloudrunv2

🟢 All tests passed!

View the build log

@zli82016 zli82016 added this pull request to the merge queue Mar 18, 2025
Merged via the queue into GoogleCloudPlatform:main with commit 1c971ce Mar 18, 2025
23 checks passed
@zli82016 zli82016 deleted the fix-cloudrun branch March 18, 2025 16:43
JaylonmcShan03 pushed a commit to JaylonmcShan03/magic-modules-jmcshan that referenced this pull request Mar 25, 2025
JaylonmcShan03 pushed a commit to JaylonmcShan03/magic-modules-jmcshan that referenced this pull request Mar 30, 2025
Dawid212 pushed a commit to Dawid212/magic-modules that referenced this pull request Apr 9, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
override-breaking-change Allows a potential breaking change to be merged service/run
Projects
None yet
3 participants