Skip to content

compute: Implement graceful switch for metadata_startup_script #8888

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

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, isGracefulMetadataStartupSwitch sets ForceNew.

The change is covered by:
TestAccComputeInstance_metadataStartupScript_update and TestAccComputeInstance_metadataStartupScript_gracefulSwitch

closes: hashicorp/terraform-provider-google#9459

compute: made `metadata_startup_script` able to be updated via graceful switch in `google_compute_instance`

Derived from GoogleCloudPlatform/magic-modules#12360

Signed-off-by: Norbert Kamiński <[email protected]>

[upstream:b2590d7dcb9f424e419fe8a1fb2c217ade96827f]

Signed-off-by: Modular Magician <[email protected]>
@modular-magician modular-magician requested a review from a team as a code owner December 10, 2024 20:18
@modular-magician modular-magician merged commit dcc0e42 into hashicorp:main Dec 10, 2024
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
Development

Successfully merging this pull request may close these issues.

Allow switching from metadata_startup_script to metadata.startup-script gracefully
1 participant