diff --git a/changelog/12911.txt b/changelog/12911.txt new file mode 100644 index 0000000000000..2c213120562ed --- /dev/null +++ b/changelog/12911.txt @@ -0,0 +1,3 @@ +```release-note:bug +cli: fixes CLI requests when namespace is both provided as argument and part of the path +``` diff --git a/command/kv_helpers.go b/command/kv_helpers.go index b058ba2d54947..354368e3f048d 100644 --- a/command/kv_helpers.go +++ b/command/kv_helpers.go @@ -124,8 +124,8 @@ func addPrefixToVKVPath(p, mountPath, apiPrefix string) string { if len(partialMountPath) <= 1 || partialMountPath[1] == ""{ break } - mountPath = partialMountPath[1] - tp = strings.TrimPrefix(p, mountPath) + mountPath = strings.TrimSuffix(partialMountPath[1], "/") + tp = strings.TrimPrefix(tp, mountPath) } return path.Join(mountPath, apiPrefix, tp)