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

Make key completion work for both kv-v1 and kv-v2 #16553

Merged
merged 2 commits into from Sep 13, 2022

Conversation

georgethebeatle
Copy link
Contributor

Fixes #16552

  • The shell completion works for both KV v1 and v2
  • Shell completion is enabled for kv get, kv put and kv patch commands

@hashicorp-cla
Copy link

hashicorp-cla commented Aug 3, 2022

CLA assistant check
All committers have signed the CLA.

Co-authored-by: Kieron Browne <kbrowne@vmware.com>
Co-authored-by: Georgi Sabev <georgethebeatle@gmail.com>
Co-authored-by: Danail Branekov <danailster@gmail.com>
Copy link
Contributor

@HridoyRoy HridoyRoy left a comment

Choose a reason for hiding this comment

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

Hi, thanks for submitting this PR. Left a few test related comments, but the functional code changes look good to me.

vault/testing.go Outdated
@@ -2041,7 +2042,7 @@ func (tc *TestCluster) initCores(t testing.T, opts *TestClusterOptions, addAudit
"path": "secret/",
"description": "key/value secret storage",
"options": map[string]string{
"version": "1",
"version": opts.KVVersion,
Copy link
Contributor

Choose a reason for hiding this comment

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

It looks like opts.KVVersion in initCores is causing a panic in some tests that use initCores because there's no default. Could you please add a default value?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

done

}

// testVaultServerCoreConfig creates a new vault cluster with the given core
// configuration. This is a lower-level test helper.
func testVaultServerCoreConfig(tb testing.TB, coreConfig *vault.CoreConfig) (*api.Client, []string, func()) {
func testVaultServerCoreConfig(tb testing.TB, coreConfig *vault.CoreConfig, opts *vault.TestClusterOptions) (*api.Client, []string, func()) {
Copy link
Contributor

Choose a reason for hiding this comment

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

This function is also used in external-tests. I think it would be simpler to leave this function unchanged so we don't have to worry about fixing tests that aren't relevant to this change, and instead adding a new function. For example,

testVaultServerCoreConfigWithOpts(...opts) {
...copy code from testVaultServerCoreConfig here and initialize the cluster with opts
}

testVaultServerCoreConfig(...) {
return testVaultServerCoreConfigWithOpts(...)
}

Copy link
Contributor Author

Choose a reason for hiding this comment

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

done

command/base_predict.go Show resolved Hide resolved
Co-authored-by: Georgi Sabev <georgethebeatle@gmail.com>
Copy link
Contributor

@HridoyRoy HridoyRoy left a comment

Choose a reason for hiding this comment

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

Lgtm!

@peteski22
Copy link
Contributor

@danail-branekov would it be possible for you to sign the CLA please? (https://github.com/hashicorp/vault/blob/main/CONTRIBUTING.md#contributor-license-agreement)

@danail-branekov
Copy link
Contributor

CLA signed, thanks!

@gcapizzi
Copy link

@HridoyRoy @peteski22 it looks like the test failures for this are not related to the PR - can you help us get them to green? Thanks!

@ncabatoff ncabatoff merged commit 3088b13 into hashicorp:main Sep 13, 2022
@ncabatoff
Copy link
Collaborator

The test failures were indeed unrelated, seems like something changed on CircleCI's side. There's a fix in main, but I didn't want to require you to apply it, since your changes aren't likely to break the remote docker tests while leaving the regular tests passing.

Thanks for the contribution!

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.

Shell completion not working for KV v2 mounts
8 participants