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

Automatically renew the token used by the Vault CA provider #8560

Merged
merged 9 commits into from
Sep 16, 2020

Conversation

kyhavlov
Copy link
Contributor

This PR adds logic to the Vault provider to renew the lease of the token automatically. It still needs a unit test, but I wanted to get feedback on whether we should make this configurable or just always enabled.

Copy link
Contributor

@dnephin dnephin left a comment

Choose a reason for hiding this comment

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

should [we] make this configurable or just always enabled.

Do the other providers auto-renew?

agent/connect/ca/provider_vault.go Outdated Show resolved Hide resolved
@kyhavlov
Copy link
Contributor Author

The other providers don't use a Vault token so there isn't a direct comparison. Renewing a token to extend the lease is pretty standard, though so I think there's a decent argument for it here, but there could also be a valid reason not to renew that I'm not seeing.

@dnephin dnephin added the theme/certificates Related to creating, distributing, and rotating certificates in Consul label Sep 10, 2020
Copy link
Contributor

@dnephin dnephin left a comment

Choose a reason for hiding this comment

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

Nice! I think I am understanding this now. Mostly some minor suggestions for goroutine management and test cleanup.

I think the only real blocker is the handling of renewer.DoneCh().

I'm not sure why codecov is reporting that so many lines are not covered by tests, I confirmed they are.

agent/consul/connect_ca_endpoint.go Outdated Show resolved Hide resolved
agent/connect/ca/provider_vault.go Outdated Show resolved Hide resolved
agent/connect/ca/provider_vault.go Outdated Show resolved Hide resolved
agent/connect/ca/provider_vault.go Outdated Show resolved Hide resolved
agent/connect/ca/provider_vault.go Outdated Show resolved Hide resolved
agent/connect/ca/provider_vault_test.go Outdated Show resolved Hide resolved
agent/connect/ca/provider_vault_test.go Outdated Show resolved Hide resolved
agent/connect/ca/provider_vault_test.go Outdated Show resolved Hide resolved
agent/connect/ca/provider_vault_test.go Outdated Show resolved Hide resolved
@kyhavlov
Copy link
Contributor Author

@dnephin This is ready for another look when you get a chance, I addressed all the comments.

Copy link
Contributor

@dnephin dnephin left a comment

Choose a reason for hiding this comment

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

Nice, LGTM!

@hashicorp-ci
Copy link
Contributor

🍒❌ Cherry pick of commit 1d22a0b onto release/1.8.x failed! Build Log

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
theme/certificates Related to creating, distributing, and rotating certificates in Consul
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants