|
|
|
@ -111,20 +111,30 @@ func (o *repoUpdateOptions) run(out io.Writer) error {
|
|
|
|
|
func updateCharts(repos []*repo.ChartRepository, out io.Writer) error {
|
|
|
|
|
fmt.Fprintln(out, "Hang tight while we grab the latest from your chart repositories...")
|
|
|
|
|
var wg sync.WaitGroup
|
|
|
|
|
var repoFailList []string
|
|
|
|
|
failRepoURLChan := make(chan string, len(repos))
|
|
|
|
|
|
|
|
|
|
for _, re := range repos {
|
|
|
|
|
wg.Add(1)
|
|
|
|
|
go func(re *repo.ChartRepository) {
|
|
|
|
|
defer wg.Done()
|
|
|
|
|
if _, err := re.DownloadIndexFile(); err != nil {
|
|
|
|
|
fmt.Fprintf(out, "...Unable to get an update from the %q chart repository (%s):\n\t%s\n", re.Config.Name, re.Config.URL, err)
|
|
|
|
|
repoFailList = append(repoFailList, re.Config.URL)
|
|
|
|
|
failRepoURLChan <- re.Config.URL
|
|
|
|
|
} else {
|
|
|
|
|
fmt.Fprintf(out, "...Successfully got an update from the %q chart repository\n", re.Config.Name)
|
|
|
|
|
}
|
|
|
|
|
}(re)
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
go func() {
|
|
|
|
|
wg.Wait()
|
|
|
|
|
close(failRepoURLChan)
|
|
|
|
|
}()
|
|
|
|
|
|
|
|
|
|
var repoFailList []string
|
|
|
|
|
for url := range failRepoURLChan {
|
|
|
|
|
repoFailList = append(repoFailList, url)
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if len(repoFailList) > 0 {
|
|
|
|
|
return fmt.Errorf("Failed to update the following repositories: %s",
|
|
|
|
|