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

GCP auth: support nested backend mount paths #1050

Merged
merged 4 commits into from May 17, 2021
Merged

Conversation

tvoran
Copy link
Member

@tvoran tvoran commented May 11, 2021

Community Note

  • Please vote on this pull request by adding a 👍 reaction to the original pull request comment to help the community and maintainers prioritize this request
  • Please do not leave "+1" comments, they generate extra noise for pull request followers and do not help prioritize the request

Continues #970 and adds an acceptance test.

Closes #880
Closes #532

Release note for CHANGELOG:

resource/vault_gcp_auth_backend: Support nested backend paths

Output from acceptance testing:

$ make testacc TESTARGS="--run TestGCPAuthBackend"
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go test $(go list ./... |grep -v 'vendor') -v --run TestGCPAuthBackend -timeout 120m
...
=== RUN   TestGCPAuthBackend_pathRegex
=== RUN   TestGCPAuthBackend_pathRegex/no_nesting
=== RUN   TestGCPAuthBackend_pathRegex/nested
=== RUN   TestGCPAuthBackend_pathRegex/nested_with_double_'role'
--- PASS: TestGCPAuthBackend_pathRegex (0.00s)
    --- PASS: TestGCPAuthBackend_pathRegex/no_nesting (0.00s)
    --- PASS: TestGCPAuthBackend_pathRegex/nested (0.00s)
    --- PASS: TestGCPAuthBackend_pathRegex/nested_with_double_'role' (0.00s)
=== RUN   TestGCPAuthBackendRole_basic
=== RUN   TestGCPAuthBackendRole_basic/simple_backend_path
=== RUN   TestGCPAuthBackendRole_basic/nested_backend_path
--- PASS: TestGCPAuthBackendRole_basic (0.51s)
    --- PASS: TestGCPAuthBackendRole_basic/simple_backend_path (0.26s)
    --- PASS: TestGCPAuthBackendRole_basic/nested_backend_path (0.25s)
=== RUN   TestGCPAuthBackendRole_gce
--- PASS: TestGCPAuthBackendRole_gce (0.14s)
=== RUN   TestGCPAuthBackendRole_deprecated
--- PASS: TestGCPAuthBackendRole_deprecated (0.13s)
=== RUN   TestGCPAuthBackend_basic
--- PASS: TestGCPAuthBackend_basic (0.11s)
PASS
ok  	github.com/hashicorp/terraform-provider-vault/vault	1.527s

Copy link
Contributor

@tomhjp tomhjp left a comment

Choose a reason for hiding this comment

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

LGTM

vault/resource_gcp_auth_backend_role.go Outdated Show resolved Hide resolved
Adjusted role name portion of regex's to match single path component,
and added unit tests for gcpAuthResourceBackendFromPath() and
gcpAuthResourceRoleFromPath().
@ghost ghost added size/M and removed size/S labels May 12, 2021
Copy link
Collaborator

@jasonodonnell jasonodonnell left a comment

Choose a reason for hiding this comment

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

LGTM

@tvoran tvoran merged commit 613285e into master May 17, 2021
@tvoran tvoran deleted the VAULT-1529/add-test branch May 17, 2021 17:46
davidmontoyago pushed a commit to davidmontoyago/terraform-provider-vault that referenced this pull request Aug 17, 2021
* Updated gcp_auth_backend_role to fix the provider issue 880.

* Adding test with nested backend path

* stricter matching for role name

Adjusted role name portion of regex's to match single path component,
and added unit tests for gcpAuthResourceBackendFromPath() and
gcpAuthResourceRoleFromPath().

Co-authored-by: Vikash Sharma <vikash.sharma@ampion.com.au>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
5 participants