"show-all-warnings" -> "show-repo-validation-errors"

Signed-off-by: Russell Cousineau <russell.cousineau@xandr.com>
pull/9611/head
Russell Cousineau 4 years ago
parent bfa5d7c0eb
commit b1bef883d4

@ -41,7 +41,7 @@ To update all the repositories, use 'helm repo update'.
var errNoRepositories = errors.New("no repositories found. You must add one before updating")
type repoUpdateOptions struct {
showAllWarnings bool
showValidationErrors bool
update func([]*repo.ChartRepository, io.Writer, bool, bool) error
repoFile string
repoCache string
@ -75,7 +75,7 @@ func newRepoUpdateCmd(out io.Writer) *cobra.Command {
// This should be deprecated in Helm 4 by update to the behaviour of `helm repo update` command.
f.BoolVar(&o.failOnRepoUpdateFail, "fail-on-repo-update-fail", false, "update fails if any of the repository updates fail")
f.BoolVar(&o.showAllWarnings, "show-all-warnings", false, "show every invalid chart while indexing repository")
f.BoolVar(&o.showValidationErrors, "show-repo-validation-errors", false, "show every invalid chart while indexing repository")
return cmd
}
@ -114,10 +114,10 @@ func (o *repoUpdateOptions) run(out io.Writer, args []string) error {
}
}
return o.update(repos, out, o.failOnRepoUpdateFail, o.showAllWarnings)
return o.update(repos, out, o.failOnRepoUpdateFail, o.showValidationErrors)
}
func updateCharts(repos []*repo.ChartRepository, out io.Writer, failOnRepoUpdateFail bool, showAllWarnings bool) error {
func updateCharts(repos []*repo.ChartRepository, out io.Writer, failOnRepoUpdateFail bool, showValidationErrors bool) error {
fmt.Fprintln(out, "Hang tight while we grab the latest from your chart repositories...")
var wg sync.WaitGroup
var repoFailList []string
@ -126,7 +126,7 @@ func updateCharts(repos []*repo.ChartRepository, out io.Writer, failOnRepoUpdate
go func(re *repo.ChartRepository) {
defer wg.Done()
var err error
if showAllWarnings {
if showValidationErrors {
_, err = re.ValidateAndDownloadIndexFile()
} else {
_, err = re.DownloadIndexFile()

@ -35,7 +35,7 @@ func TestUpdateCmd(t *testing.T) {
var out bytes.Buffer
// Instead of using the HTTP updater, we provide our own for this test.
// The TestUpdateCharts test verifies the HTTP behavior independently.
updater := func(repos []*repo.ChartRepository, out io.Writer, failOnRepoUpdateFail bool, showAllWarnings bool) error {
updater := func(repos []*repo.ChartRepository, out io.Writer, failOnRepoUpdateFail bool, showValidationErrors bool) error {
for _, re := range repos {
fmt.Fprintln(out, re.Config.Name)
}
@ -60,7 +60,7 @@ func TestUpdateCmdMultiple(t *testing.T) {
var out bytes.Buffer
// Instead of using the HTTP updater, we provide our own for this test.
// The TestUpdateCharts test verifies the HTTP behavior independently.
updater := func(repos []*repo.ChartRepository, out io.Writer, failOnRepoUpdateFail bool, showAllWarnings bool) error {
updater := func(repos []*repo.ChartRepository, out io.Writer, failOnRepoUpdateFail bool, showValidationErrors bool) error {
for _, re := range repos {
fmt.Fprintln(out, re.Config.Name)
}
@ -86,7 +86,7 @@ func TestUpdateCmdInvalid(t *testing.T) {
var out bytes.Buffer
// Instead of using the HTTP updater, we provide our own for this test.
// The TestUpdateCharts test verifies the HTTP behavior independently.
updater := func(repos []*repo.ChartRepository, out io.Writer, failOnRepoUpdateFail bool, showAllWarnings bool) error {
updater := func(repos []*repo.ChartRepository, out io.Writer, failOnRepoUpdateFail bool, showValidationErrors bool) error {
for _, re := range repos {
fmt.Fprintln(out, re.Config.Name)
}

@ -326,7 +326,7 @@ func IndexDirectory(dir, baseURL string) (*IndexFile, error) {
//
// The source parameter is only used for logging.
// This will fail if API Version is not set (ErrNoAPIVersion) or if the unmarshal fails.
func loadIndex(data []byte, source string, consolidateWarnings bool) (*IndexFile, error) {
func loadIndex(data []byte, source string, consolidateValidationErrors bool) (*IndexFile, error) {
i := &IndexFile{}
if len(data) == 0 {
@ -345,15 +345,15 @@ func loadIndex(data []byte, source string, consolidateWarnings bool) (*IndexFile
}
if err := cvs[idx].Validate(); err != nil {
invalidCharts++
if !consolidateWarnings {
if !consolidateValidationErrors {
log.Printf("skipping loading invalid entry for chart %q %q from %s: %s", name, cvs[idx].Version, source, err)
}
cvs = append(cvs[:idx], cvs[idx+1:]...)
}
}
}
if invalidCharts > 0 && consolidateWarnings {
log.Printf("skipped loading %d invalid chart entries from %s\nrun 'helm repo update --show-all-warnings' for full list of invalid entries", invalidCharts, source)
if invalidCharts > 0 && consolidateValidationErrors {
log.Printf("skipped loading %d invalid chart entries from %s\nrun 'helm repo update --show-repo-validation-errors' for full list of invalid entries", invalidCharts, source)
}
i.SortEntries()
if i.APIVersion == "" {

Loading…
Cancel
Save