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

support legacy kv engine of type generic #308

Merged
merged 1 commit into from
Nov 7, 2024

Conversation

guillier
Copy link

@guillier guillier commented Nov 4, 2024

engine type error was partly fixed with issue #232 but still remains a problem with export.

vkv export -p generic_se/path
panic: interface conversion: interface {} is nil, not map[string]interface {}

goroutine 1 [running]:
github.com/FalcoSuessgott/vkv/pkg/vault.(*Vault).GetEngineTypeVersion(0xc000354948?, {0xc000354948, 0x3})
	/home/runner/work/vkv/vkv/pkg/vault/engine.go:55 +0x228
github.com/FalcoSuessgott/vkv/pkg/printer/secret.(*Printer).printBase(0xc0003da0a0, 0xc0004d8b70?)
	/home/runner/work/vkv/vkv/pkg/printer/secret/base.go:36 +0x377
github.com/FalcoSuessgott/vkv/pkg/printer/secret.(*Printer).Out(0xc0003da0a0, {0xae16a0?, 0xc0004d87b0?})
	/home/runner/work/vkv/vkv/pkg/printer/secret/secret_printer.go:224 +0x2ac
github.com/FalcoSuessgott/vkv/cmd.NewExportCmd.func1(0xc0004b6200?, {0xc00061f460?, 0x4?, 0xb99cfc?})
	/home/runner/work/vkv/vkv/cmd/export.go:84 +0x594
github.com/spf13/cobra.(*Command).execute(0xc0004a7b00, {0xc00061f440, 0x2, 0x2})
	/home/runner/go/pkg/mod/github.com/spf13/[email protected]/command.go:985 +0xabc
github.com/spf13/cobra.(*Command).ExecuteC(0xc0004a7800)
	/home/runner/go/pkg/mod/github.com/spf13/[email protected]/command.go:1117 +0x3ff
github.com/spf13/cobra.(*Command).Execute(...)
	/home/runner/go/pkg/mod/github.com/spf13/[email protected]/command.go:1041
github.com/FalcoSuessgott/vkv/cmd.Execute()
	/home/runner/work/vkv/vkv/cmd/root.go:117 +0x18
main.main()
	/home/runner/work/vkv/vkv/main.go:15 +0x4f

With the fix:

vkv export -p generic_se/path
generic_se/ [type=kv1]
└── path
...

Copy link

codecov bot commented Nov 4, 2024

Codecov Report

Attention: Patch coverage is 0% with 3 lines in your changes missing coverage. Please review.

Project coverage is 69.66%. Comparing base (6b528bc) to head (e47a404).
Report is 124 commits behind head on master.

Files with missing lines Patch % Lines
pkg/vault/engine.go 0.00% 2 Missing and 1 partial ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master     #308      +/-   ##
==========================================
+ Coverage   69.59%   69.66%   +0.06%     
==========================================
  Files          29       35       +6     
  Lines        1322     2126     +804     
==========================================
+ Hits          920     1481     +561     
- Misses        290      503     +213     
- Partials      112      142      +30     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@FalcoSuessgott
Copy link
Owner

Will fix the tests later. Thanks for the fix! You might wanna consider vkv exporting -> importing to a KVv2 engine :D

@FalcoSuessgott FalcoSuessgott merged commit 14892b3 into FalcoSuessgott:master Nov 7, 2024
6 of 7 checks passed
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.

3 participants