|
|
|
@ -19,7 +19,7 @@ package repo
|
|
|
|
|
import (
|
|
|
|
|
"bytes"
|
|
|
|
|
"encoding/json"
|
|
|
|
|
"log"
|
|
|
|
|
"log/slog"
|
|
|
|
|
"os"
|
|
|
|
|
"path"
|
|
|
|
|
"path/filepath"
|
|
|
|
@ -154,7 +154,7 @@ func (i IndexFile) MustAdd(md *chart.Metadata, filename, baseURL, digest string)
|
|
|
|
|
// Deprecated: Use index.MustAdd instead.
|
|
|
|
|
func (i IndexFile) Add(md *chart.Metadata, filename, baseURL, digest string) {
|
|
|
|
|
if err := i.MustAdd(md, filename, baseURL, digest); err != nil {
|
|
|
|
|
log.Printf("skipping loading invalid entry for chart %q %q from %s: %s", md.Name, md.Version, filename, err)
|
|
|
|
|
slog.Error("skipping loading invalid entry for chart %q %q from %s: %s", md.Name, md.Version, filename, err)
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@ -356,7 +356,7 @@ func loadIndex(data []byte, source string) (*IndexFile, error) {
|
|
|
|
|
for name, cvs := range i.Entries {
|
|
|
|
|
for idx := len(cvs) - 1; idx >= 0; idx-- {
|
|
|
|
|
if cvs[idx] == nil {
|
|
|
|
|
log.Printf("skipping loading invalid entry for chart %q from %s: empty entry", name, source)
|
|
|
|
|
slog.Warn("skipping loading invalid entry for chart %q from %s: empty entry", name, source)
|
|
|
|
|
continue
|
|
|
|
|
}
|
|
|
|
|
// When metadata section missing, initialize with no data
|
|
|
|
@ -367,7 +367,7 @@ func loadIndex(data []byte, source string) (*IndexFile, error) {
|
|
|
|
|
cvs[idx].APIVersion = chart.APIVersionV1
|
|
|
|
|
}
|
|
|
|
|
if err := cvs[idx].Validate(); ignoreSkippableChartValidationError(err) != nil {
|
|
|
|
|
log.Printf("skipping loading invalid entry for chart %q %q from %s: %s", name, cvs[idx].Version, source, err)
|
|
|
|
|
slog.Warn("skipping loading invalid entry for chart %q %q from %s: %s", name, cvs[idx].Version, source, err)
|
|
|
|
|
cvs = append(cvs[:idx], cvs[idx+1:]...)
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|