Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
小 白蛋
Vault
Commits
7d6b9f7d
Commit
7d6b9f7d
authored
3 years ago
by
Annalise Diroff
Browse files
Options
Download
Email Patches
Plain Diff
Support retrieiving kv trailing spaces
parent
5dcdcb47
Branches unavailable
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
command/base_helpers.go
+9
-0
command/base_helpers.go
command/kv_get.go
+6
-0
command/kv_get.go
with
15 additions
and
0 deletions
+15
-0
command/base_helpers.go
+
9
-
0
View file @
7d6b9f7d
...
...
@@ -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
)
...
...
This diff is collapsed.
Click to expand it.
command/kv_get.go
+
6
-
0
View file @
7d6b9f7d
...
...
@@ -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
())
...
...
This diff is collapsed.
Click to expand it.
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment
Menu
Projects
Groups
Snippets
Help