From aadc6fefee117bcacc63f5047c2f5064b91934a2 Mon Sep 17 00:00:00 2001 From: Michal Pristas Date: Fri, 17 Jan 2025 17:30:53 +0100 Subject: [PATCH] lint --- internal/pkg/agent/application/upgrade/step_unpack.go | 4 ++-- internal/pkg/agent/install/flavors.go | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/internal/pkg/agent/application/upgrade/step_unpack.go b/internal/pkg/agent/application/upgrade/step_unpack.go index 819db25c074..6c854b6ff99 100644 --- a/internal/pkg/agent/application/upgrade/step_unpack.go +++ b/internal/pkg/agent/application/upgrade/step_unpack.go @@ -237,7 +237,7 @@ func skipFnFromZip(log *logger.Logger, r *zip.ReadCloser, detectedFlavor string, flavor, err := install.Flavor(detectedFlavor, "", registry) if err != nil { - if err == install.ErrUnknownFlavor { + if errors.Is(err, install.ErrUnknownFlavor) { // unknown flavor fallback to copy all return func(relPath string) bool { return false }, nil } @@ -524,7 +524,7 @@ func skipFnFromTar(log *logger.Logger, archivePath string, flavor string) (insta var allowedPaths []string flavorDefinition, err := loadFlavor(flavor) if err != nil { - if err == install.ErrUnknownFlavor { + if errors.Is(err, install.ErrUnknownFlavor) { // unknown flavor fallback to copy all return func(relPath string) bool { return false }, nil } diff --git a/internal/pkg/agent/install/flavors.go b/internal/pkg/agent/install/flavors.go index 21ce7e4a5f4..34443a09a5a 100644 --- a/internal/pkg/agent/install/flavors.go +++ b/internal/pkg/agent/install/flavors.go @@ -45,7 +45,7 @@ func LoadRegistry(r io.Reader) (FlavorsRegistry, error) { flavorMap := make(map[string][]string) d := yaml.NewDecoder(r) if err := d.Decode(flavorMap); err != nil { - return FlavorsRegistry{}, fmt.Errorf("failed to parse flavor registry: %v", err) + return FlavorsRegistry{}, fmt.Errorf("failed to parse flavor registry: %w", err) } reg := make(FlavorsRegistry)