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

Make cloud composer environment image version updateable. #1755

Conversation

jmcarp
Copy link
Contributor

@jmcarp jmcarp commented May 13, 2019

Cloud composer now allows image version to be updated as a beta feature. This drops ForceNew from the image_version option and implements version updates for the beta provider. I'm new to magic modules, so still figuring out how to test this.

@modular-magician
Copy link
Collaborator

Hello! I am a robot who works on Magic Modules PRs.

I have detected that you are a community contributor, so your PR will be assigned to someone with a commit-bit on this repo for initial review. They will authorize it to run through our CI pipeline, which will generate downstream PRs.

Thanks for your contribution! A human will be with you soon.

@jmcarp
Copy link
Contributor Author

jmcarp commented May 20, 2019

cc @danawillow @rileykarson

@danawillow danawillow self-requested a review May 21, 2019 17:59
@modular-magician
Copy link
Collaborator

Hi! I'm the modular magician, I work on Magic Modules.
This PR seems not to have generated downstream PRs before, as of 93731097ec83cf4ee94d4c3d7dbf41c078b0f11b.

Pull request statuses

No diff detected in terraform-google-conversion.
No diff detected in Ansible.
No diff detected in Inspec.

New Pull Requests

I built this PR into one or more new PRs on other repositories, and when those are closed, this PR will also be merged and closed.
depends: hashicorp/terraform-provider-google-beta#741
depends: hashicorp/terraform-provider-google#3681

Copy link
Contributor

@danawillow danawillow left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @jmcarp! Can you also add this property to TestAccComposerEnvironment_update in resource_composer_environment_test.go?

},
}
if config != nil && config.SoftwareConfig != nil {
patchObj.Config.SoftwareConfig = config.SoftwareConfig.ImageVersion
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
patchObj.Config.SoftwareConfig = config.SoftwareConfig.ImageVersion
patchObj.Config.SoftwareConfig.ImageVersion = config.SoftwareConfig.ImageVersion

@jmcarp jmcarp force-pushed the composer-update-image-version branch from 9373109 to aff02ff Compare May 25, 2019 18:13
@jmcarp
Copy link
Contributor Author

jmcarp commented May 26, 2019

Thanks @danawillow. I added your fix and updated the tests, and got the updated test passing.

name = "%s"
region = "us-central1"

config {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does the test still work without this block? My philosophy is that the basic test should be, for the most part, the minimum that you need in order to get a resource provisioned.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, looks like I didn't need to add this block. Updated.

@jmcarp jmcarp force-pushed the composer-update-image-version branch from aff02ff to ef87d27 Compare May 28, 2019 20:03
@modular-magician
Copy link
Collaborator

Hi! I'm the modular magician, I work on Magic Modules.
I see that this PR has already had some downstream PRs generated. Any open downstreams are already updated to your most recent commit, ef87d27.

Pull request statuses

terraform-provider-google-beta already has an open PR.
No diff detected in terraform-google-conversion.
terraform-provider-google already has an open PR.
No diff detected in Ansible.
No diff detected in Inspec.

New Pull Requests

I didn't open any new pull requests because of this PR.

@@ -295,6 +295,8 @@ resource "google_composer_environment" "test" {
node_count = 4

software_config {
image_version = "composer-1.7.0-airflow-1.10.2"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah sorry I didn't catch this earlier- this also needs beta-only guards, since without it the test in the GA provider will destroy/create instead of doing an update.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, updated.

@jmcarp jmcarp force-pushed the composer-update-image-version branch from ef87d27 to cb3e6d0 Compare May 29, 2019 00:31
@modular-magician
Copy link
Collaborator

Hi! I'm the modular magician, I work on Magic Modules.
I see that this PR has already had some downstream PRs generated. Any open downstreams are already updated to your most recent commit, cb3e6d0.

Pull request statuses

terraform-provider-google-beta already has an open PR.
No diff detected in terraform-google-conversion.
terraform-provider-google already has an open PR.
No diff detected in Ansible.
No diff detected in Inspec.

New Pull Requests

I didn't open any new pull requests because of this PR.

Copy link
Contributor

@danawillow danawillow left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @jmcarp, looks good!

jmcarp and others added 2 commits May 29, 2019 17:55
Tracked submodules are build/terraform-beta build/terraform-mapper build/terraform build/ansible build/inspec.
@modular-magician modular-magician force-pushed the composer-update-image-version branch from cb3e6d0 to 2b68b3c Compare May 29, 2019 17:55
@modular-magician modular-magician merged commit 2806b65 into GoogleCloudPlatform:master May 29, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants