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

chore: refactor deprecated Vault calls #1768

Merged

Conversation

thevilledev
Copy link
Contributor

Minor refactor for Vault related functionality in the dependency package:

  • Use Vault NewLifetimeWatcher() instead of NewWatcher() as it is deprecated (see API client reference here). For compatibility purposes, RenewBehaviour is the same as with the previous functionality.
  • Use Vault ReadRaw() instead of RawRequest() as it is deprecated (see API client reference here).
  • For VaultReadQuery dependency, remove opts from being passed further down to other functions as it is and won't be used. Query parameters (like version) for Vault read calls are stored in a separate queryValues field. Other dependencies which implement the same Fetch() interface (like FileQuery) won't pass it further either if the parameter is not needed.
  • Remove unused stopChan() function from VaultPKIQuery.

@thevilledev thevilledev requested a review from a team as a code owner June 26, 2023 17:15
@thevilledev thevilledev requested review from steshageo and removed request for a team June 26, 2023 17:15
@@ -140,7 +138,7 @@ func (d *VaultReadQuery) Type() Type {
return TypeVault
}

func (d *VaultReadQuery) readSecret(clients *ClientSet, opts *QueryOptions) (*api.Secret, error) {
Copy link
Contributor

Choose a reason for hiding this comment

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

good catch on opts not being used

Copy link
Contributor

@roncodingenthusiast roncodingenthusiast left a comment

Choose a reason for hiding this comment

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

LGTM! great work @thevilledev

@roncodingenthusiast roncodingenthusiast merged commit 2d446f0 into hashicorp:main Sep 15, 2023
@thevilledev thevilledev deleted the chore/vault-deprecated-calls branch September 18, 2023 14:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants