@ -113,11 +113,6 @@ func (m *Manager) Build() error {
}
}
}
}
// Check that all of the repos we're dependent on actually exist.
if err := m . hasAllRepos ( lock . Dependencies ) ; err != nil {
return err
}
if ! m . SkipUpdate {
if ! m . SkipUpdate {
// For each repo in the file, update the cached copy of that repo
// For each repo in the file, update the cached copy of that repo
if err := m . UpdateRepositories ( ) ; err != nil {
if err := m . UpdateRepositories ( ) ; err != nil {
@ -382,40 +377,6 @@ func (m *Manager) safeDeleteDep(name, dir string) error {
return nil
return nil
}
}
// hasAllRepos ensures that all of the referenced deps are in the local repo cache.
func ( m * Manager ) hasAllRepos ( deps [ ] * chart . Dependency ) error {
rf , err := loadRepoConfig ( m . RepositoryConfig )
if err != nil {
return err
}
repos := rf . Repositories
// Verify that all repositories referenced in the deps are actually known
// by Helm.
missing := [ ] string { }
Loop :
for _ , dd := range deps {
// If repo is from local path, continue
if strings . HasPrefix ( dd . Repository , "file://" ) {
continue
}
if dd . Repository == "" {
continue
}
for _ , repo := range repos {
if urlutil . Equal ( repo . URL , strings . TrimSuffix ( dd . Repository , "/" ) ) {
continue Loop
}
}
missing = append ( missing , dd . Repository )
}
if len ( missing ) > 0 {
return errors . Errorf ( "no repository definition for %s. Please add the missing repos via 'helm repo add'" , strings . Join ( missing , ", " ) )
}
return nil
}
// resolveRepoNames returns the repo names of the referenced deps which can be used to fetch the cached index file
// resolveRepoNames returns the repo names of the referenced deps which can be used to fetch the cached index file
// and replaces aliased repository URLs into resolved URLs in dependencies.
// and replaces aliased repository URLs into resolved URLs in dependencies.
func ( m * Manager ) resolveRepoNames ( deps [ ] * chart . Dependency ) ( map [ string ] string , error ) {
func ( m * Manager ) resolveRepoNames ( deps [ ] * chart . Dependency ) ( map [ string ] string , error ) {