Commit 7d6b9f7d authored by Annalise Diroff's avatar Annalise Diroff
Browse files

Support retrieiving kv trailing spaces

parent 5dcdcb47
Branches unavailable
No related merge requests found
Showing with 15 additions and 0 deletions
+15 -0
......@@ -38,6 +38,15 @@ func sanitizePath(s string) string {
return ensureNoTrailingSlash(ensureNoLeadingSlash(s))
}
// hasTrailingSpace checks to see if there is trailing space
func hasTrailingSpace(s string) bool {
x := strings.TrimSpace(s)
if x != s {
return true
}
return false
}
// ensureTrailingSlash ensures the given string has a trailing slash.
func ensureTrailingSlash(s string) string {
s = strings.TrimSpace(s)
......
......@@ -134,7 +134,13 @@ func (c *KVGetCommand) Run(args []string) int {
} else {
// In this case, this arg is a path-like combination of mountPath/secretPath.
// (e.g. "secret/foo")
origPath := args[0]
partialPath = sanitizePath(args[0])
if hasTrailingSpace(origPath) {
partialPath = partialPath + " "
}
mountPath, v2, err = isKVv2(partialPath, client)
if err != nil {
c.UI.Error(err.Error())
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment