Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
H
helm3
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
go
helm3
Commits
170cff83
Unverified
Commit
170cff83
authored
Jan 04, 2018
by
Taylor Thomas
Committed by
GitHub
Jan 04, 2018
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #3120 from TimDumol/feat/dep-up-error-msg
feat(helm): add better error message to 'dep up'
parents
1e373043
8fae16fb
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
26 additions
and
2 deletions
+26
-2
manager.go
pkg/downloader/manager.go
+19
-2
manager_test.go
pkg/downloader/manager_test.go
+7
-0
No files found.
pkg/downloader/manager.go
View file @
170cff83
...
...
@@ -354,7 +354,7 @@ func (m *Manager) hasAllRepos(deps []*chartutil.Dependency) error {
}
}
if
len
(
missing
)
>
0
{
return
fmt
.
Errorf
(
"no repository definition for %s.
Try
'helm repo add'"
,
strings
.
Join
(
missing
,
", "
))
return
fmt
.
Errorf
(
"no repository definition for %s.
Please add the missing repos via
'helm repo add'"
,
strings
.
Join
(
missing
,
", "
))
}
return
nil
}
...
...
@@ -406,7 +406,24 @@ func (m *Manager) getRepoNames(deps []*chartutil.Dependency) (map[string]string,
}
}
if
len
(
missing
)
>
0
{
return
nil
,
fmt
.
Errorf
(
"no repository definition for %s. Try 'helm repo add'"
,
strings
.
Join
(
missing
,
", "
))
if
len
(
missing
)
>
0
{
errorMessage
:=
fmt
.
Sprintf
(
"no repository definition for %s. Please add them via 'helm repo add'"
,
strings
.
Join
(
missing
,
", "
))
// It is common for people to try to enter "stable" as a repository instead of the actual URL.
// For this case, let's give them a suggestion.
containsNonURL
:=
false
for
_
,
repo
:=
range
missing
{
if
!
strings
.
Contains
(
repo
,
"//"
)
&&
!
strings
.
HasPrefix
(
repo
,
"@"
)
&&
!
strings
.
HasPrefix
(
repo
,
"alias:"
)
{
containsNonURL
=
true
}
}
if
containsNonURL
{
errorMessage
+=
`
Note that repositories must be URLs or aliases. For example, to refer to the stable
repository, use "https://kubernetes-charts.storage.googleapis.com/" or "@stable" instead of
"stable". Don't forget to add the repo, too ('helm repo add').`
}
return
nil
,
errors
.
New
(
errorMessage
)
}
}
return
reposMap
,
nil
}
...
...
pkg/downloader/manager_test.go
View file @
170cff83
...
...
@@ -106,6 +106,13 @@ func TestGetRepoNames(t *testing.T) {
},
err
:
true
,
},
{
name
:
"no repo definition failure -- stable repo"
,
req
:
[]
*
chartutil
.
Dependency
{
{
Name
:
"oedipus-rex"
,
Repository
:
"stable"
},
},
err
:
true
,
},
{
name
:
"no repo definition failure"
,
req
:
[]
*
chartutil
.
Dependency
{
...
...
Write
Preview
Markdown
is supported
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