changing from log to slog

Signed-off-by: Robert Sirchia <rsirchia@outlook.com>
pull/30592/head
Robert Sirchia 7 months ago
parent 8602af9e92
commit 48f03d316b
No known key found for this signature in database
GPG Key ID: C2D40F4D8196E874

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

Loading…
Cancel
Save