Signed-off-by: Rick Brouwer <rickbrouwer@gmail.com>
pull/30946/head
Rick Brouwer 4 months ago
parent 30452b0794
commit 71c49a8194
No known key found for this signature in database

@ -617,11 +617,9 @@ func (m *Manager) resolveRepoNames(deps []*chart.Dependency) (map[string]string,
}
if !found {
repository := dd.Repository
// Add if URL
// Check if it's a valid URL
_, err := url.ParseRequestURI(repository)
if err == nil {
depKey := resolver.DependencyKey(dd.Name, repository, i)
reposMap[depKey] = repository
continue
}
missing = append(missing, repository)

@ -166,9 +166,7 @@ func TestGetRepoNames(t *testing.T) {
req: []*chart.Dependency{
{Name: "oedipus-rex", Repository: "http://example.com/test"},
},
expect: map[string]string{
expectedKey("oedipus-rex", "http://example.com/test", 0): "http://example.com/test",
},
expect: map[string]string{},
},
{
name: "no repo definition failure -- stable repo",
@ -225,12 +223,11 @@ func TestGetRepoNames(t *testing.T) {
{
name: "multiple dependencies with same name but different repos",
req: []*chart.Dependency{
{Name: "common-chart", Repository: "http://example.com"},
{Name: "common-chart", Repository: "http://other.com"},
{Name: "common-chart", Repository: "http://example.com"}, // Known repo
{Name: "common-chart", Repository: "http://other.com"}, // Unknown repo
},
expect: map[string]string{
expectedKey("common-chart", "http://example.com", 0): "testing",
expectedKey("common-chart", "http://other.com", 1): "http://other.com",
},
},
}

Loading…
Cancel
Save