Skip to content

Commit

Permalink
make updating config.software_config.image_version beta-only (#5832) (#…
Browse files Browse the repository at this point in the history
…11309)

Signed-off-by: Modular Magician <magic-modules@google.com>
  • Loading branch information
modular-magician authored Mar 18, 2022
1 parent 51ca55d commit 916fe7b
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 15 deletions.
3 changes: 3 additions & 0 deletions .changelog/5832.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
```release-note:breaking-change
composer: made the `google_composer_environment.config.software_config.image_version` field immutable as this functionality is only available in beta.
```
16 changes: 1 addition & 15 deletions google/resource_composer_environment.go
Original file line number Diff line number Diff line change
Expand Up @@ -319,6 +319,7 @@ func resourceComposerEnvironment() *schema.Resource {
Type: schema.TypeString,
Computed: true,
Optional: true,
ForceNew: true,
AtLeastOneOf: composerSoftwareConfigKeys,
ValidateFunc: validateRegexp(composerEnvironmentVersionRegexp),
DiffSuppressFunc: composerImageVersionDiffSuppress,
Expand Down Expand Up @@ -793,21 +794,6 @@ func resourceComposerEnvironmentUpdate(d *schema.ResourceData, meta interface{})
return err
}

if d.HasChange("config.0.software_config.0.image_version") {
patchObj := &composer.Environment{
Config: &composer.EnvironmentConfig{
SoftwareConfig: &composer.SoftwareConfig{},
},
}
if config != nil && config.SoftwareConfig != nil {
patchObj.Config.SoftwareConfig.ImageVersion = config.SoftwareConfig.ImageVersion
}
err = resourceComposerEnvironmentPatchField("config.softwareConfig.imageVersion", userAgent, patchObj, d, tfConfig)
if err != nil {
return err
}
}

if d.HasChange("config.0.software_config.0.airflow_config_overrides") {
patchObj := &composer.Environment{
Config: &composer.EnvironmentConfig{
Expand Down

0 comments on commit 916fe7b

Please sign in to comment.