Skip to content

GCP auth: support nested backend mount paths - #1050

Merged
tvoran merged 4 commits into
masterfrom
VAULT-1529/add-test
May 17, 2021
Merged

GCP auth: support nested backend mount paths#1050
tvoran merged 4 commits into
masterfrom
VAULT-1529/add-test

Conversation

@tvoran

@tvoran tvoran commented May 11, 2021

Copy link
Copy Markdown
Member

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

@tomhjp tomhjp left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

LGTM

Comment thread vault/resource_gcp_auth_backend_role.go Outdated
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
Comment thread vault/resource_gcp_auth_backend_role.go

@jasonodonnell jasonodonnell left a comment

Copy link
Copy Markdown
Contributor

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