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

Define "vault_consul_secret_backend_role" resource #480

Merged

Conversation

p0pr0ck5
Copy link
Contributor

The commit provides a new resource to manage roles associated with a Consul secrets engine (https://www.vaultproject.io/api/secret/consul/index.html#create-update-role).

This is a bare-bones effort to start a feedback process; I'm not sure if there's a desire to support Consul < 1.4 for this provider.

@ghost ghost added the size/L label Jul 31, 2019
@tyrannosaurus-becks tyrannosaurus-becks self-assigned this Aug 2, 2019
@tyrannosaurus-becks
Copy link
Contributor

Hi @p0pr0ck5 !

This PR needs a couple more things before it's ready for review - mainly, tests, and docs. It's more fully outlined here. Happy to circle back and take a look when those are good to go.

Thanks for your work on this so far! Definitely interested in getting coverage onto this Consul endpoint.

@p0pr0ck5
Copy link
Contributor Author

p0pr0ck5 commented Aug 5, 2019

Thanks @tyrannosaurus-becks! I will work on these. In the interim, can you let me know if this is expected?

 $ make test
==> Checking that code complies with gofmt requirements...
gofmt needs running on the following files:
./vault/resource_pki_secret_backend_root_cert.go
./vault/resource_pki_secret_backend_intermediate_cert_request.go
You can use the command: `make fmt` to reformat code.
GNUmakefile:32: recipe for target 'fmtcheck' failed
make: *** [fmtcheck] Error 1

@tyrannosaurus-becks
Copy link
Contributor

tyrannosaurus-becks commented Aug 5, 2019

@p0pr0ck5 strange! Must have been happening on the version of master from which your branch was created. It's not happening on the current master branch because if it were, tests would fail. Should be resolvable by either pulling master and merging it in, or running make fmt on your branch. I hope that helps!

@p0pr0ck5
Copy link
Contributor Author

p0pr0ck5 commented Aug 5, 2019

Weird, still seeing it when keeping up with this project's master:

poprocks@screech ~/code/go/terraform-provider-vault (master) [10:54:06] [130]
 $ git log --oneline | head
dde958b Merge pull request #490 from terraform-providers/deprecate-duplicate-resource
b123e59 begin deprecating duplicate resource
e867cd8 Merge pull request #462 from hashitop/f-expose-local-flag-on-vault_mount
0ed5a67 Add test case for local mount
f392766 Merge pull request #482 from terraform-providers/update-openapi
8577e5e Merge pull request #476 from lawliet89/gcp-roleset-enhancements
cbaa5be Merge pull request #465 from nritholtz/vault_ldap_auth_backend_group_force_new
d7761aa Merge pull request #443 from petems/add_duo_mfa
81c0dfa Adds MFA Duo configuration
715afcb update openapi doc
poprocks@screech ~/code/go/terraform-provider-vault (master) [10:54:08] [0]
 $ make test
==> Checking that code complies with gofmt requirements...
gofmt needs running on the following files:
./vault/resource_pki_secret_backend_root_cert.go
./vault/resource_pki_secret_backend_intermediate_cert_request.go
You can use the command: `make fmt` to reformat code.
GNUmakefile:32: recipe for target 'fmtcheck' failed
make: *** [fmtcheck] Error 1
poprocks@screech ~/code/go/terraform-provider-vault (master) [10:54:12] [2]
 $ go version
go version go1.12.6 linux/amd64

I know it's not really related to this PR so I'm not super concerned.

@tyrannosaurus-becks
Copy link
Contributor

@p0pr0ck5 ah! I bet we have different go versions. Locally I'm on Go 12.7 and CircleCI is on 12.5. I've noticed that when moving to new versions of Go, I've seen differences like that - things that once were considered properly formatted weren't any longer.

@ghost ghost added the documentation label Sep 11, 2019
@ghost ghost added size/XL and removed size/L labels Sep 11, 2019
@peimanja
Copy link

Any update on this one?

@tyrannosaurus-becks
Copy link
Contributor

Closing due to lack of activity. Thank you for your work, though, and feel free to reopen it if you get a chance to circle back and fix the tests.

@p0pr0ck5
Copy link
Contributor Author

@tyrannosaurus-becks I updated this PR with documentation and tests 20 days ago. The CI run failed due to a timeout grabbing some Go dependencies. Can this please be re-opened and reviewed?

@p0pr0ck5
Copy link
Contributor Author

Specifically the test failure is:

go: git.apache.org/[email protected]: git fetch -f origin refs/heads/*:refs/heads/* refs/tags/*:refs/tags/* in /home/circleci/.go_workspace/pkg/mod/cache/vcs/83dba939f95a790e497d565fc4418400145a1a514f955fa052f662d56e920c3e: exit status 128:
	fatal: unable to access 'https://git.apache.org/thrift.git/': Failed to connect to git.apache.org port 443: Connection timed out
go: error loading module requirements
Exited with code 1

@tyrannosaurus-becks
Copy link
Contributor

@p0pr0ck5 reopened it! Ah yes, the thrift failure, sorry I missed that. It's since been resolved on master. I will merge it in and run tests to see if they now pass. Thank you!

@p0pr0ck5
Copy link
Contributor Author

No worries, I force-pushed this without leaving a comment here, should have communicated that better. Thanks so much!

@tyrannosaurus-becks
Copy link
Contributor

Hi @p0pr0ck5 ! OK, so I merged in master and I found I'm still getting some test failures:

# github.com/terraform-providers/terraform-provider-vault/vault [github.com/terraform-providers/terraform-provider-vault/vault.test]
vault/resource_consul_secret_backend_role_test.go:5:2: imported and not used: "strings"
vault/resource_consul_secret_backend_role_test.go:62:2: missing return at end of function
vault/resource_consul_secret_backend_role_test.go:77:47: undefined: path
vault/resource_consul_secret_backend_role_test.go:77:53: undefined: namestring
vault/resource_consul_secret_backend_role_test.go:87:5: undefined: path
vault/resource_consul_secret_backend_role_test.go:87:11: undefined: name

Would you be willing to fix those issues, and merge in master and push it up? Happy to circle back around when the tests are green. I'm aiming to do a release in the next week or two, so if it's updated soon enough I may still be able to include it.

@p0pr0ck5
Copy link
Contributor Author

p0pr0ck5 commented Oct 1, 2019

@tyrannosaurus-becks sorry for the noise here. Tests are passing now :)

@p0pr0ck5
Copy link
Contributor Author

p0pr0ck5 commented Oct 7, 2019

Ping @tyrannosaurus-becks - this should be ready for review. Would love to be able to make an upcoming release if possible. Please let me know if anything else is needed! Thanks!

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.

This looks fantastic! I'll make sure it gets merged before the upcoming release.

vault/resource_consul_secret_backend_role.go Outdated Show resolved Hide resolved
@tyrannosaurus-becks tyrannosaurus-becks merged commit 5cf4644 into hashicorp:master Oct 10, 2019
@p0pr0ck5 p0pr0ck5 deleted the consul-secret-backend-role branch October 23, 2019 01:23
dandandy pushed a commit to dandandy/terraform-provider-vault that referenced this pull request Jun 17, 2021
…role

Define "vault_consul_secret_backend_role" resource
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants