Skip to content

Fix autofilling values in initialize_params.resource_policies causing instance to recreate #12552

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
Dec 20, 2024

Conversation

karolgorc
Copy link
Contributor

@karolgorc karolgorc commented Dec 12, 2024

closes hashicorp/terraform-provider-google#19735

This field will no longer take API values if the field is not set causing an instance recreation.

Release Note Template for Downstream PRs (will be copied)

See Write release notes for guidance.

compute: Setting resource policies for `google_compute_instance` outside of terraform or using `google_compute_disk_resource_policy_attachment` will no longer affect the `boot_disk.initialize_params.resource_policies` field

@github-actions github-actions bot requested a review from hao-nan-li December 12, 2024 14:33
Copy link

Hello! I am a robot. Tests will require approval from a repository maintainer to run.

@hao-nan-li, a repository maintainer, has been assigned to review your changes. If you have not received review feedback within 2 business days, please leave a comment on this PR asking them to take a look.

You can help make sure that review is quick by doing a self-review and by running impacted tests locally.

@modular-magician modular-magician added awaiting-approval Pull requests that need reviewer's approval to run presubmit tests service/compute-instances and removed awaiting-approval Pull requests that need reviewer's approval to run presubmit tests labels Dec 12, 2024
@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 ( 1 file changed, 7 insertions(+), 1 deletion(-))
google-beta provider: Diff ( 1 file changed, 7 insertions(+), 1 deletion(-))

Breaking Change(s) Detected

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

  • Field boot_disk.initialize_params.resource_policies transitioned from optional+computed to optional google_compute_instance - 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.

Copy link
Contributor

@hao-nan-li hao-nan-li left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks like a breaking-change and should be included in major releases. The next major release is estimated to occur on August 2025. go/terraform-releases#major-releases

@modular-magician
Copy link
Collaborator

Tests analytics

Total tests: 230
Passed tests: 171
Skipped tests: 59
Affected tests: 0

Click here to see the affected service packages
  • compute

🔴 Errors occurred during REPLAYING mode. Please fix them to complete your PR.

View the build log

@karolgorc karolgorc changed the title fix resource policies diff on initialize params Fix autofilling values in initialize_params.resource_policies causing instance to recreate Dec 13, 2024
@karolgorc
Copy link
Contributor Author

I think this will still work with Computed: true. All we want to achieve here is for this value not to cause diff if it's not set in the user config.

@github-actions github-actions bot requested a review from hao-nan-li December 17, 2024 09:55
@hao-nan-li
Copy link
Contributor

I think this will still work with Computed: true. All we want to achieve here is for this value not to cause diff if it's not set in the user config.

Yeah I agree with you, but removing Computed will cause breaking changes to existing users.

@karolgorc
Copy link
Contributor Author

Tested this with Computed:true. It does work, just needed to add a second condition to tighten this up a bit. This should no longer be a breaking change

@modular-magician modular-magician added the awaiting-approval Pull requests that need reviewer's approval to run presubmit tests label Dec 20, 2024
Copy link

@hao-nan-li This PR has been waiting for review for 3 weekdays. Please take a look! Use the label disable-review-reminders to disable these notifications.

@modular-magician modular-magician removed the awaiting-approval Pull requests that need reviewer's approval to run presubmit tests label Dec 20, 2024
@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, 8 insertions(+), 1 deletion(-))
google-beta provider: Diff ( 2 files changed, 8 insertions(+), 1 deletion(-))

@hao-nan-li hao-nan-li removed the 7.0.0 label Dec 20, 2024
@modular-magician
Copy link
Collaborator

Tests analytics

Total tests: 1077
Passed tests: 1004
Skipped tests: 73
Affected tests: 0

Click here to see the affected service packages
  • compute

🟢 All tests passed!

View the build log

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

Successfully merging this pull request may close these issues.

Since provider 6.3.0 boot_disk.initialize_params.resource_policies is available and force rebuilt
3 participants