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

New Resource: vault_cert_auth_backend_role #123

Conversation

angrylogic
Copy link
Contributor

This PR allows for managing the Vault Cert authentication backend.

@kmcquade
Copy link

kmcquade commented Aug 7, 2018

@angrylogic maybe if you add the new-resource label then they'll pay attention to this? I know they're overloaded at this time but maybe it would make a visual statement that Hashi should prioritize this provider if we had a ton of "new resource" labels applied to the relevant open PRs.

@tyrannosaurus-becks tyrannosaurus-becks self-assigned this Sep 14, 2018
Copy link
Contributor

@tyrannosaurus-becks tyrannosaurus-becks left a comment

Choose a reason for hiding this comment

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

@angrylogic thank you for contributing this! It looks great!

I checked out the branch and ran the acceptance tests and they're not passing for me. Here are the steps to reproduce:

  • Run Vault 11.1 locally via vault server -dev
  • Export TF_ACC=1, VAULT_TOKEN=whatever, and VAULT_ADDR=http://localhost:8200

And then when I run the tests I get:

--- FAIL: TestCertAuthBackend_basic (0.03s)
    testing.go:434: Step 0 error: Check failed: resource not found in state

Let me know if I'm doing something wrong.

Happy to approve and merge once you get a chance to look at it. Apologies for the long delay while the repo was being transitioned from the Terraform team to the Vault team.

Delete: certAuthResourceRead,

Schema: map[string]*schema.Schema{
"name": &schema.Schema{
Copy link
Contributor

Choose a reason for hiding this comment

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

Would it be possible to strip the redundant field name declarations here and on the rest of the fields?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@tyrannosaurus-becks - I'm not sure I follow what you mean re: redundant field names here.

Copy link
Contributor

Choose a reason for hiding this comment

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

Sorry, I didn't phrase it very well. My code editor complains if, in a map like map[string]*schema.Schema, then &schema.Schema is also declared below. Here's a visual example:
screenshot from 2018-09-14 13-54-19
It's underlining and greying out those words because they can be safely omitted.

I know it hasn't always been that way, but it would be great to go that way going forward. I'm thinking of doing a quick pass through the pre-existing code updating stuff like that.


log.Printf("[DEBUG] Writing %q to cert auth backend", path)
_, err := client.Logical().Write(path, data)
d.SetId(path)
Copy link
Contributor

Choose a reason for hiding this comment

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

Could this be moved up a line so it's not between the err and the err check?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

No problem, will fix.

@angrylogic
Copy link
Contributor Author

I'll go ahead and get those tests and changes sorted out early next week - same for the other PR. Thanks for taking a look at these @tyrannosaurus-becks !

angrylogic and others added 4 commits September 17, 2018 16:41
This PR allows for managing the Vault Cert authentication backend.
I had renamed the resource but forgotten to update the references in the
state file.  Tests are now passing.
@angrylogic angrylogic force-pushed the resource_cert_auth_backend_role branch from 16c9303 to bae50e7 Compare September 17, 2018 21:04
@ghost ghost added the size/XL label Sep 17, 2018
@angrylogic
Copy link
Contributor Author

@tyrannosaurus-becks -- Rebased and I think I've covered all the requested changes.

Tests passing for me now:

BOS-M-2533:vault gharris$ go test -test.v -run TestCertAuthBackend_basic
=== RUN   TestCertAuthBackend_basic
--- PASS: TestCertAuthBackend_basic (0.18s)
PASS
ok      github.com/terraform-providers/terraform-provider-vault/vault   0.926s

Thanks!

@tyrannosaurus-becks tyrannosaurus-becks merged commit 0f1ca30 into hashicorp:master Sep 17, 2018
dandandy pushed a commit to dandandy/terraform-provider-vault that referenced this pull request Jun 17, 2021
…ackend_role

New Resource: vault_cert_auth_backend_role
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants