-
Notifications
You must be signed in to change notification settings - Fork 1.8k
compute: Implement graceful switch for metadata_startup_script #12360
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
compute: Implement graceful switch for metadata_startup_script #12360
Conversation
Hello! I am a robot. Tests will require approval from a repository maintainer to run. @c2thorn, 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. |
09f36dc
to
a98d2f0
Compare
Hi there, I'm the Modular magician. I've detected the following information about your changes: Diff reportYour PR generated some diffs in downstreams - here they are.
Missing test reportYour PR includes resource fields which are not covered by any test. Resource: resource "google_compute_instance_from_machine_image" "primary" {
metadata_startup_script = # value needed
}
Resource: resource "google_compute_instance_from_template" "primary" {
metadata_startup_script = # value needed
}
|
Tests analyticsTotal tests: 1064 Click here to see the affected service packages
Action takenFound 1 affected test(s) by replaying old test recordings. Starting RECORDING based on the most recent commit. Click here to see the affected tests
|
🔴 Tests failed during RECORDING mode: 🔴 Errors occurred during RECORDING mode. Please fix them to complete your PR. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi @Asiderr
Did you test the Forcenew/regular update by hand?
Should we not get a new update test specifically for updating metadata_startup_script
without Forcenew?
This patch checks whether a graceful switch (without ForceNew) is available between `metadata_startup_script` and `metadata.startup-script`. Graceful switch can be executed in two situations: 1. When `metadata_startup_script` is created with the old value of `metadata.startup-script`. 2. When `metadata_startup_script` is deleted and the old value remains in `metadata.startup-script` For all other changes in `metadata_startup_script`, function sets ForceNew. Also it adds TestAccComputeInstance_metadataStartupScript_gracefulSwitch test that covers those changes. Closes: hashicorp/terraform-provider-google#9459 Signed-off-by: Norbert Kamiński <[email protected]>
a98d2f0
to
3eb8e86
Compare
Hi @c2thorn
Yes, I tested all of the potential configurations and it works as expected.
I've added test |
Hi there, I'm the Modular magician. I've detected the following information about your changes: Diff reportYour PR generated some diffs in downstreams - here they are.
Missing test reportYour PR includes resource fields which are not covered by any test. Resource: resource "google_compute_instance_from_machine_image" "primary" {
metadata_startup_script = # value needed
}
Resource: resource "google_compute_instance_from_template" "primary" {
metadata_startup_script = # value needed
}
|
Tests analyticsTotal tests: 1067 Click here to see the affected service packages
Action takenFound 1 affected test(s) by replaying old test recordings. Starting RECORDING based on the most recent commit. Click here to see the affected tests
|
@c2thorn This PR has been waiting for review for 3 weekdays. Please take a look! Use the label |
@GoogleCloudPlatform/terraform-team @c2thorn This PR has been waiting for review for 1 week. Please take a look! Use the label |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM thanks @Asiderr for the update test.
Logic looks good for the forcenew function and should be otherwise safe considering the previous logic was always ForceNew
…eCloudPlatform#12360) Signed-off-by: Norbert Kamiński <[email protected]>
…eCloudPlatform#12360) Signed-off-by: Norbert Kamiński <[email protected]>
This patch checks whether a graceful switch (without ForceNew) is available between
metadata_startup_script
andmetadata.startup-script
. Graceful switch can be executed in two situations:metadata_startup_script
is created with the old value ofmetadata.startup-script
.metadata_startup_script
is deleted and the old value remains inmetadata.startup-script
.For all other changes in
metadata_startup_script
,isGracefulMetadataStartupSwitch
sets ForceNew.The change is covered by:
TestAccComputeInstance_metadataStartupScript_update
andTestAccComputeInstance_metadataStartupScript_gracefulSwitch
closes: hashicorp/terraform-provider-google#9459