-
Notifications
You must be signed in to change notification settings - Fork 1.7k
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
Add Snapshot location to compute snapshot #3896
Add Snapshot location to compute snapshot #3896
Conversation
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. Thanks for your contribution! A human will be with you soon. @megan07, please review this PR or find an appropriate assignee. |
Hi! I'm the modular magician. Your PR generated some diffs in downstreams - here they are. Diff report:Terraform GA: Diff ( 2 files changed, 70 insertions(+)) |
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 @upodroid! Thanks for your contribution! Would you be able to add some tests/examples with these please?
I didn't write a test for the KMS fields. I don't currently see one using CMEK, there is a CSEK test though. |
Hi! I'm the modular magician. Your PR generated some diffs in downstreams - here they are. Diff report:Terraform GA: Diff ( 3 files changed, 84 insertions(+)) |
Hi @upodroid! Thanks again for this contribution - and I apologize for my delay in responding, I wanted to make sure I had ample time to review it. As for tests, I think you can probably add tests to Also, I was playing around with it a little and I think if Let me know if you have more questions! Thanks! And sorry again for the delay! |
@megan07 The tests are kind of passing now. The APIs are being a bit dodgy. The service account was used to encrypt the disk first and then create the snapshot. The CMEK works for the disk creation but fails the snapshot creation even thought it happens after the disk is created. I tried it manually via the APIs and it works correctly. Terraform is a bit flaky.
|
Hi! I'm the modular magician. Your PR generated some diffs in downstreams - here they are. Diff report:Terraform GA: Diff ( 6 files changed, 217 insertions(+), 2 deletions(-)) |
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.
After making a few of the suggested changes, I ran the tests locally and ran into a couple other things - the Disk
resource has a decoder
(templates/terraform/decoders/disk.erb
) that decodes the encryption keys, the child attributes are hard-coded in that decoder, so now that we've added kmsKeyServiceAccount
to it's children, we'll need to make sure it's added there as well.
Along the same lines, you'll see in that decoder that one of the things decoded is that the kmsKeyName
actually returns the version, so we handle that in there - and we need to do the same thing in a decoder for Snapshot
now as well.
Let me know if you have any questions, but I think this should get us close! Thanks for all of your work put in here!
One other thing, as I was looking into the code locally, I saw some extra whitespace at the end of lines, would you mind cleaning that up a bit too, please? Thanks! |
This is working now. That decoder hint gave me ideas on how to fix PR 3939.
|
… into snapshot-location
Hi! I'm the modular magician. Your PR generated some diffs in downstreams - here they are. Diff report:Terraform GA: Diff ( 7 files changed, 289 insertions(+), 6 deletions(-)) |
Hi! I'm the modular magician. Your PR generated some diffs in downstreams - here they are. Diff report:Terraform GA: Diff ( 7 files changed, 260 insertions(+), 6 deletions(-)) |
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.
Looks good! Thank you!
Fixes: hashicorp/terraform-provider-google#6941
If this PR is for Terraform, I acknowledge that I have:
make test
andmake lint
to ensure it passes unit and linter tests.Release Note Template for Downstream PRs (will be copied)