-
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 support for is_secret_data_base64
in secret_version and secret_version_access datasources for global and regional stacks
#11877
Add support for is_secret_data_base64
in secret_version and secret_version_access datasources for global and regional stacks
#11877
Conversation
…et versions datasources
…atasource website
…a_base64-in-secret-version-datasources
Hello! I am a robot. Tests will require approval from a repository maintainer to run. @rileykarson, a repository maintainer, has been assigned to review your changes. If you have not received review feedback within 2 business days, please leave a comment on this PR asking them to take a look. You can help make sure that review is quick by doing a self-review and by running impacted tests locally. |
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
…a_base64-in-secret-version-datasources
@rileykarson Could you please review this PR? |
@rileykarson This PR has been waiting for review for 3 weekdays. Please take a look! Use the label |
…a_base64-in-secret-version-datasources
@GoogleCloudPlatform/terraform-team @rileykarson This PR has been waiting for review for 1 week. Please take a look! Use the label |
…a_base64-in-secret-version-datasources
@rileykarson Could you please review this 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.
Just a few small nits, see inline.
if err != nil { | ||
return fmt.Errorf("Error decoding secret manager secret version data: %s", err.Error()) | ||
var secretData string | ||
dIsSecretDataBase64, ok := d.Get("is_secret_data_base64").(bool) |
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.
nit: You can omit the ok
- the return of d.Get is guaranteed to be a bool
by the schema, as the type is TypeBool.
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.
Yeah, I got your point and I've removed the checks as discussed. However, I originally included them to enhance the defensiveness of the type assertions based on the review comments I received on PR #11754.
Out of curiosity, are there specific scenarios—perhaps during string type assertions—where it would be advisable to retain such checks?
@@ -74,6 +98,43 @@ func testAccCheckDatasourceSecretManagerSecretVersion(n, expected string) resour | |||
} | |||
} | |||
|
|||
func testAccCheckDatasourceSecretManagerSecretVersionSecretData(datasource, resource string) resource.TestCheckFunc { |
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.
func testAccCheckDatasourceSecretManagerSecretVersionSecretData(datasource, resource string) resource.TestCheckFunc { | |
func testAccCheckSecretManagerSecretVersionSecretDataDatasourceMatchesResource(datasource, resource string) resource.TestCheckFunc { |
(+ callers)
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.
I've updated the function name wherever required.
@@ -201,3 +250,40 @@ func testAccCheckDataSourceSecretManagerRegionalRegionalSecretVersion(n, expecte | |||
return nil | |||
} | |||
} | |||
|
|||
func testAccCheckDataSourceSecretManagerRegionalRegionalSecretVersionSecretData(datasource, resource string) resource.TestCheckFunc { |
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.
func testAccCheckDataSourceSecretManagerRegionalRegionalSecretVersionSecretData(datasource, resource string) resource.TestCheckFunc { | |
func testAccCheckSecretManagerRegionalRegionalSecretVersionSecretDataDatasourceMatchesResource(datasource, resource string) resource.TestCheckFunc { |
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.
I've updated the function name wherever required.
…a_base64-in-secret-version-datasources
Hi there, I'm the Modular magician. I've detected the following information about your changes: Diff reportYour PR generated some diffs in downstreams - here they are.
|
Tests analyticsTotal tests: 84 Click here to see the affected service packages
Action takenFound 4 affected test(s) by replaying old test recordings. Starting RECORDING based on the most recent commit. Click here to see the affected tests
|
🟢 Tests passed during RECORDING mode: 🟢 No issues found for passed tests after REPLAYING rerun. 🟢 All tests passed! |
Hi there, I'm the Modular magician. I've detected the following information about your changes: Diff reportYour PR generated some diffs in downstreams - here they are.
|
Tests analyticsTotal tests: 84 Click here to see the affected service packages
🟢 All tests passed! View the build log |
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, thanks!
…version_access datasources for global and regional stacks (GoogleCloudPlatform#11877)
…version_access datasources for global and regional stacks (GoogleCloudPlatform#11877)
…version_access datasources for global and regional stacks (GoogleCloudPlatform#11877)
…version_access datasources for global and regional stacks (GoogleCloudPlatform#11877)
…version_access datasources for global and regional stacks (GoogleCloudPlatform#11877)
…version_access datasources for global and regional stacks (GoogleCloudPlatform#11877)
Add support for
is_secret_data_base64
in secret_version and secret_version_access datasources for global and regional stacks. I've also removed the redundanttestAccCheckDatasourceSecretManagerSecretVersionAccess
function and used the existingtestAccCheckDatasourceSecretManagerSecretVersion
function.fixes hashicorp/terraform-provider-google#17321
Release Note Template for Downstream PRs (will be copied)