Skip to content

Commit 70db6ba

Browse files
Cloud Composer - handle "empty changes" to recovery_config (#14604) (#23715)
[upstream:8877ca825f28f962c708a61423324d4fdb4eb352] Signed-off-by: Modular Magician <[email protected]>
1 parent 828c936 commit 70db6ba

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

.changelog/14604.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
unknown: Cloud Composer - handle "empty changes" to recovery_config

google/services/composer/resource_composer_environment.go

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1530,7 +1530,9 @@ func resourceComposerEnvironmentUpdate(d *schema.ResourceData, meta interface{})
15301530
patchObj.Config.RecoveryConfig = config.RecoveryConfig
15311531
}
15321532
err = resourceComposerEnvironmentPatchField("config.RecoveryConfig.ScheduledSnapshotsConfig", userAgent, patchObj, d, tfConfig)
1533-
if err != nil {
1533+
// Empty ScheduledSnapshotsConfig and config with scheduled snapshots explicitly disabled (and nothing else configured) represent in fact the same configuration.
1534+
// If applying a change fails specifically because it does not bring any actual modification, this error should be silently ignored.
1535+
if err != nil && !strings.Contains(err.Error(), "No change in configuration.") {
15341536
return err
15351537
}
15361538
}

0 commit comments

Comments
 (0)