-
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 EncryptionConfig to Cloud Composer's EnvironmentConfig #4310
Conversation
Right now I'm mostly hoping for some guidance regarding running tests, as I'm consistently failing with:
|
@@ -700,6 +722,18 @@ func resourceComposerEnvironmentUpdate(d *schema.ResourceData, meta interface{}) | |||
return err | |||
} | |||
} | |||
<% end -%> |
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.
Probably better to combine these two conditions since they're identical, here and elsewhere.
}, | ||
// This is a terrible clean-up step in order to get destroy to succeed, | ||
// due to dangling firewall rules left by the Composer Environment blocking network deletion. | ||
// TODO(emilyye): Remove this check if firewall rules bug gets fixed by Composer. |
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.
maybe update the name on the todo if you still need it?
In case anybody finds this while searching for the error I posted earlier - in my case the problem was an outdated Go package describing Composer API: https://pkg.go.dev/google.golang.org/api/composer/v1beta1 |
@dzarmola You will need to rebase or merge master so that this builds successfully I believe. There were directory structure changes since this was opened |
…Config used for environment creation
Thanks, rebased. |
/gcbrun The version of the googleapis sdk should be updated now |
I have triggered VCR tests based on this PR's diffs. See the results here: "https://ci-oss.hashicorp.engineering/viewQueued.html?itemId=170348" |
I have triggered VCR tests in RECORDING mode for the following tests that failed during VCR: TestAccActiveDirectoryDomainTrust_activeDirectoryDomainTrustBasicExample|TestAccComposerEnvironment_withEncryptionConfig|TestAccPrivatecaCertificateAuthority_privatecaCertificateAuthorityCmekExample You can view the result here: "https://ci-oss.hashicorp.engineering/viewQueued.html?itemId=170443" |
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.
Are you able to successfully run the added test here?
I'm seeing a strange error:
Error: Error waiting to create Environment: Error waiting for Creating Environment: Error code 2, message: Http error status code: 400
Http error message: BAD REQUEST
Errors in: [GKE cluster]; Error messages:
{"ResourceType":"gcp-types/container-v1beta1:projects.locations.clusters","ResourceErrorCode":"400","ResourceErrorMessage":{"code":400,"message":"\n\t(1) Network \"tf-test-composer-net-8587385686315371018\" has no route to the default internet gateway. To fix this, add a route with destRange '0.0.0.0/0' and nextHopGateway 'default-internet-gateway'\n\t(2) network \"tf-test-composer-net-8587385686315371018\" does not exist.","status":"INVALID_ARGUMENT",
which seems to indicate that the network isn't set up correctly. But this looks identical to the other tests in this file. This could just be a flaky test, I'll rerun
"kms_key_name": { | ||
Type: schema.TypeString, | ||
Required: true, | ||
Description: `Optional. Customer-managed Encryption Key available through Google's Key Management Service. Cannot be updated.`, |
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.
If this cannot be updated as indicated by the description, it should probably be marked ForceNew: true
to force Terraform to recreate the resource if this field is changed.
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.
Thanks, added!
With regard to tests - I've noticed some problems with deletion after the test is complete (a firewall rule related issue, which, based on the comments, is known to happen), but nothing at creation.
Hey, is there something I could work on here to bring us closer to merging? It's an important part for Cloud Composer CMEK integration |
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.
Ah, sorry I started this review but didn't send it!
Required: true, | ||
Description: `Optional. Customer-managed Encryption Key available through Google's Key Management Service. Cannot be updated.`, | ||
}, | ||
ForceNew: true, |
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.
This should be one line up. Currently getting:
google-beta/resource_composer_environment.go:440:10: undefined: ForceNew
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.
Thanks! Fixed.
/gcbrun |
I have triggered VCR tests based on this PR's diffs. See the results here: "https://ci-oss.hashicorp.engineering/viewQueued.html?itemId=172009" |
/gcbrun |
I have triggered VCR tests based on this PR's diffs. See the results here: "https://ci-oss.hashicorp.engineering/viewQueued.html?itemId=172932" |
I have triggered VCR tests in RECORDING mode for the following tests that failed during VCR: TestAccRedisInstanceDatasource_basic|TestAccComposerEnvironment_withEncryptionConfig|TestAccRedisInstance_redisInstanceBasicExample|TestAccRedisInstance_redisInstanceFullExample|TestAccRedisInstance_update|TestAccRedisInstance_regionFromLocation|TestAccRedisInstance_redisInstanceAuthEnabled You can view the result here: "https://ci-oss.hashicorp.engineering/viewQueued.html?itemId=172934" |
Tests failed during RECORDING mode: TestAccComposerEnvironment_withEncryptionConfig Please fix these to complete your PR |
Composer encryption test is failing, but unsure if it is because of anything in the provider. Error was:
I'll try running it again, but is it possible that the config doesn't set up the environment correctly? |
/gcbrun |
I have triggered VCR tests based on this PR's diffs. See the results here: "https://ci-oss.hashicorp.engineering/viewQueued.html?itemId=172936" |
I have triggered VCR tests in RECORDING mode for the following tests that failed during VCR: TestAccBigtableAppProfile_bigtableAppProfileSingleclusterExample|TestAccComposerEnvironment_withEncryptionConfig|TestAccRedisInstance_redisInstancePrivateServiceExample You can view the result here: "https://ci-oss.hashicorp.engineering/viewQueued.html?itemId=172941" |
Tests failed during RECORDING mode: TestAccRedisInstance_redisInstancePrivateServiceExample Please fix these to complete your PR |
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 to me! Only test failing is flaky.
Thanks for the addition
Add a new section (EncryptionConfig) to Cloud Composer's EnvironmentConfig used for environment creation and updating
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)