-
Notifications
You must be signed in to change notification settings - Fork 540
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 provider tests and fix S3 secret issue #1173
Add provider tests and fix S3 secret issue #1173
Conversation
@vinay-gopalan Hey! 😄 If you could take a quick look at this, it is just a field I forgot in my initial PR. I added some tests to make sure this doesn't happen again. |
@@ -429,7 +432,8 @@ func readSnapshotAgentConfigResource(d *schema.ResourceData, meta interface{}) e | |||
} | |||
} | |||
|
|||
if val, ok := resp.Data["google_endpoint"]; ok { | |||
// Vault is returning 'false' for this instead of null. |
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 is spooky and should probably be looked into on the Vault side. When this string isn't set, Vault returns false
instead of null
or an empty string like the other raft snapshot storage providers. Handling it here in the provider for now though.
~/docker/vault-enterprise-raft
➜ VAULT_ADDR="http://localhost:28200" vault write sys/storage/raft/snapshot-auto/config/example interval=1 retain=1 path_prefix=demo storage_type=google-gcs google_gcs_bucket=demo
Success! Data written to: sys/storage/raft/snapshot-auto/config/example
~/docker/vault-enterprise-raft
➜ VAULT_ADDR="http://localhost:28200" vault read sys/storage/raft/snapshot-auto/config/example
Key Value
--- -----
file_prefix vault-snapshot
google_disable_tls false
google_endpoint false
google_gcs_bucket demo
google_service_account_key n/a
interval 1
path_prefix demo
retain 1
storage_type google-gcs
~/docker/vault-enterprise-raft
➜ VAULT_ADDR="http://localhost:28200" vault write sys/storage/raft/snapshot-auto/config/example2 interval=1 retain=1 path_prefix=demo storage_type=aws-s3 aws_s3_bucket=demo aws_s3_region=us-east-1
Success! Data written to: sys/storage/raft/snapshot-auto/config/example2
~/docker/vault-enterprise-raft
➜ VAULT_ADDR="http://localhost:28200" vault read sys/storage/raft/snapshot-auto/config/example2
Key Value
--- -----
aws_access_key_id n/a
aws_s3_bucket demo
aws_s3_disable_tls false
aws_s3_enable_kms false
aws_s3_endpoint n/a
aws_s3_force_path_style false
aws_s3_kms_key n/a
aws_s3_region us-east-1
aws_s3_server_side_encryption false
aws_secret_access_key n/a
aws_session_token n/a
file_prefix vault-snapshot
interval 1
path_prefix demo
retain 1
storage_type aws-s3 You'll notice that |
Yup! Sorry I was under the impression it was sending non-null values for all requests. I confirmed with the |
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.
LGTM 👍
We're holding off on merging things until this PR to upgrade to TF SDK v2 goes in #1175 Will merge your PR once that goes through! Thanks :) |
I should have had tests for the cloud providers from the start. Feel free to pin this one squarely on my laziness. 😛
I can barely hold in my excitement for the day running TF in debug mode doesn't output 50 SDK deprecation warnings per resource. 😉 Thanks again for reviewing. |
@mbillow this fix will go out in the v2.24.1 release tomorrow. |
Co-authored-by: Marc Billow <[email protected]>
There was an attribute left out of my initial merge request (#1139) that is preventing the complete setup of resources with those changes. Fixing that error and adding tests to catch similar issues in the future.
Community Note
Relates #1139
Release note for CHANGELOG:
Output from acceptance testing: