fixing a bug for cli when namespace is in both arg and path (#12911)
* fixing a bug for cli when namespace is in both arg and path * Add a changelog
This commit is contained in:
parent
96c49ee528
commit
c79cd1c744
|
@ -0,0 +1,3 @@
|
||||||
|
```release-note:bug
|
||||||
|
cli: fixes CLI requests when namespace is both provided as argument and part of the path
|
||||||
|
```
|
|
@ -124,8 +124,8 @@ func addPrefixToVKVPath(p, mountPath, apiPrefix string) string {
|
||||||
if len(partialMountPath) <= 1 || partialMountPath[1] == ""{
|
if len(partialMountPath) <= 1 || partialMountPath[1] == ""{
|
||||||
break
|
break
|
||||||
}
|
}
|
||||||
mountPath = partialMountPath[1]
|
mountPath = strings.TrimSuffix(partialMountPath[1], "/")
|
||||||
tp = strings.TrimPrefix(p, mountPath)
|
tp = strings.TrimPrefix(tp, mountPath)
|
||||||
}
|
}
|
||||||
|
|
||||||
return path.Join(mountPath, apiPrefix, tp)
|
return path.Join(mountPath, apiPrefix, tp)
|
||||||
|
|
Loading…
Reference in New Issue