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

[VAULT-3157] Move mergeStates utils from Agent to api module #12731

Merged
merged 11 commits into from Oct 6, 2021

Conversation

vinay-gopalan
Copy link
Contributor

@vinay-gopalan vinay-gopalan commented Oct 4, 2021

This PR moves the utils mergeStates, compareStates from api_proxy.go in Agent to client.go in the API module. In addition, ParseRequiredStates from the hashicorp/vault/vault package is also moved to client.go. The ParseRequiredStates and mergeStates methods are also made public.

These methods need to be accessed by the Terraform Vault Provider in order to provide consistent X-Vault-Index header support.

@vinay-gopalan vinay-gopalan requested a review from a team October 4, 2021 21:47
@vercel vercel bot temporarily deployed to Preview – vault-storybook October 4, 2021 21:51 Inactive
@vercel vercel bot temporarily deployed to Preview – vault October 4, 2021 21:51 Inactive
@vercel vercel bot temporarily deployed to Preview – vault October 4, 2021 23:07 Inactive
@vercel vercel bot temporarily deployed to Preview – vault-storybook October 4, 2021 23:07 Inactive
api/client.go Outdated Show resolved Hide resolved
api/client.go Outdated Show resolved Hide resolved
Copy link
Contributor

@jasonodonnell jasonodonnell left a comment

Choose a reason for hiding this comment

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

LGTM!

@vercel vercel bot temporarily deployed to Preview – vault October 5, 2021 16:38 Inactive
@vercel vercel bot temporarily deployed to Preview – vault-storybook October 5, 2021 16:38 Inactive
api/client.go Outdated Show resolved Hide resolved
api/client.go Outdated Show resolved Hide resolved
@vercel vercel bot temporarily deployed to Preview – vault-storybook October 5, 2021 17:11 Inactive
@vercel vercel bot temporarily deployed to Preview – vault October 5, 2021 17:11 Inactive
Copy link
Member

@calvn calvn left a comment

Choose a reason for hiding this comment

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

Few minor nits, but otherwise looks good!

api/client.go Outdated Show resolved Hide resolved
api/client.go Outdated Show resolved Hide resolved
api/client.go Outdated Show resolved Hide resolved
@vercel vercel bot temporarily deployed to Preview – vault October 5, 2021 17:36 Inactive
@vercel vercel bot temporarily deployed to Preview – vault-storybook October 5, 2021 17:36 Inactive
@ncabatoff
Copy link
Contributor

Better make sure this works on Enterprise too. ParseRequiredState is used in some ent-specific files.

@vinay-gopalan
Copy link
Contributor Author

vinay-gopalan commented Oct 5, 2021

Better make sure this works on Enterprise too. ParseRequiredState is used in some ent-specific files.

@ncabatoff the last spot that needs to be updated in Vault Enterprise is here in core_util_ent.go: https://github.com/hashicorp/vault-enterprise/blob/main/vault/core_util_ent.go#L1271

I'll open a PR on the vault-enterprise side by importing the api package in that file and updating that line once this PR is merged in and the changes available in the enterprise repo. Does that sound reasonable?

@ncabatoff
Copy link
Contributor

Better make sure this works on Enterprise too. ParseRequiredState is used in some ent-specific files.

@ncabatoff the last spot that needs to be updated in Vault Enterprise is here in core_util_ent.go: https://github.com/hashicorp/vault-enterprise/blob/main/vault/core_util_ent.go#L1271

I'll open a PR on the vault-enterprise side by importing the api package in that file and updating that line once this PR is merged in and the changes available in the enterprise repo. Does that sound reasonable?

Yup, that's the usual practice. Just don't want you to be caught unawares and scrambling to fix the build.

api/client.go Outdated Show resolved Hide resolved
@vercel vercel bot temporarily deployed to Preview – vault-storybook October 6, 2021 16:47 Inactive
@vercel vercel bot temporarily deployed to Preview – vault October 6, 2021 16:47 Inactive
@vinay-gopalan vinay-gopalan merged commit 45b0179 into main Oct 6, 2021
@vinay-gopalan vinay-gopalan deleted the fix-vault-index-header branch October 6, 2021 18:01
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.

None yet

5 participants