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

Don't recreate GCE instances when updating resource_policies property #10029

Closed

Conversation

hanneshayashi
Copy link

This should fix the behaviour described in #9981.
Basically, the change removes the ForceNew attribute from the resource_policies property of google_compute_instance and adds code to check for changes of the property. If the property changed, all old values get removed and all new values (if there are any) get added.

@hanneshayashi
Copy link
Author

Friendly ping @edwardmedia. I appreciate that you assigned #9981 to me, but unfortunately I can't approve my own PR 😃
Would you mind reviewing my changes? Thank you!

@nat-henderson
Copy link
Contributor

This looks good to me, I will run the tests.

@hanneshayashi
Copy link
Author

hanneshayashi commented Sep 15, 2021

Looks like the test is failing on an unrelated file. Do you want me to rebase the branch with the current master?
Edit: Just for completeness sake, I did run "make fmt" and it did not produce any changes 🤷

@nat-henderson
Copy link
Contributor

Hm, yeah, the linter is failing ... but that can't realistically be your fault, can it? Let's move to the next step. :)

This code is automatically generated by a tool called Magic Modules, which keeps this code in sync across ga, beta, and other occasional early access Terraform providers.

Fortunately, this file is pretty easy to edit in Magic Modules - it's here:

https://github.com/GoogleCloudPlatform/magic-modules/blob/master/mmv1/third_party/terraform/resources/resource_compute_instance.go.erb

You'll notice that it uses some erb features - to exclude things from ga, for instance - but that shouldn't impact your change. Can you move these changes to that file and open a new PR in Magic Modules, linking it to this PR?

@hanneshayashi
Copy link
Author

I have created a new PR for Magic Modules: GoogleCloudPlatform/magic-modules#5206

@hanneshayashi
Copy link
Author

Closing this, because this was merged into Magic Modules.

@github-actions
Copy link

I'm going to lock this pull request because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues.
If you have found a problem that seems related to this change, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Oct 29, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants