Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
barry cho
Rancher
Commits
44bad669
Commit
44bad669
authored
5 years ago
by
rajashree
Committed by
Alena Prokharchyk
5 years ago
Browse files
Options
Download
Email Patches
Plain Diff
Redact password in error message
parent
d720be4b
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
pkg/catalog/helm/setup.go
+15
-0
pkg/catalog/helm/setup.go
with
15 additions
and
0 deletions
+15
-0
pkg/catalog/helm/setup.go
+
15
-
0
View file @
44bad669
...
...
@@ -193,6 +193,21 @@ func (h *Helm) updateGit(fetchLatest bool) (string, error) {
}
if
changed
{
if
err
=
git
.
Update
(
h
.
LocalPath
,
commit
);
err
!=
nil
{
if
h
.
username
!=
""
&&
h
.
password
!=
""
{
// the error string contains url which is formed using url.UserInfo.String(),
// which escapes the following characters-> '@', '/', '?' and ':'
// h.password doesn't escape these characters, so to use strings.Contains(), obtain the escaped password
userInfo
:=
url
.
UserPassword
(
h
.
username
,
h
.
password
)
userPwd
:=
strings
.
SplitN
(
userInfo
.
String
(),
":"
,
2
)
if
len
(
userPwd
)
!=
2
{
return
""
,
errors
.
New
(
"error getting userinfo url"
)
}
pwd
:=
userPwd
[
1
]
if
strings
.
Contains
(
err
.
Error
(),
pwd
)
{
errStr
:=
strings
.
Replace
(
err
.
Error
(),
pwd
+
"@"
,
"***@"
,
1
)
err
=
errors
.
New
(
errStr
)
}
}
return
""
,
errors
.
Wrap
(
err
,
"Update failed"
)
}
logrus
.
Debugf
(
"Helm updated git repository for catalog [%s]"
,
h
.
catalogName
)
...
...
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