Skip to content

Commit

Permalink
Fix new lint errors
Browse files Browse the repository at this point in the history
Signed-off-by: Phil Estes <[email protected]>
  • Loading branch information
estesp committed Oct 2, 2024
1 parent 5c99f10 commit a1b9757
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions v2/cmd/manifest-tool/push.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,12 @@ import (
yaml "gopkg.in/yaml.v3"
)

const (
fmtCantResolvePath = "Can't resolve path to %q: %v"
fmtCantReadYAML = "Can't read YAML file %q: %v"
fmtCantUnmarshalYAML = "Can't unmarshal YAML file %q: %v"
)

var pushCmd = &cli.Command{
Name: "push",
Usage: "push a manifest list/OCI index entry to a registry with provided image details",
Expand All @@ -41,15 +47,15 @@ var pushCmd = &cli.Command{

filename, err := filepath.Abs(filePath)
if err != nil {
logrus.Fatalf(fmt.Sprintf("Can't resolve path to %q: %v", filePath, err))
logrus.Fatal(fmt.Sprintf(fmtCantResolvePath, filePath, err))
}
yamlFile, err := os.ReadFile(filename)
if err != nil {
logrus.Fatalf(fmt.Sprintf("Can't read YAML file %q: %v", filePath, err))
logrus.Fatal(fmt.Sprintf(fmtCantReadYAML, filePath, err))
}
err = yaml.Unmarshal(yamlFile, &yamlInput)
if err != nil {
logrus.Fatalf(fmt.Sprintf("Can't unmarshal YAML file %q: %v", filePath, err))
logrus.Fatal(fmt.Sprintf(fmtCantUnmarshalYAML, filePath, err))
}

manifestType := types.Docker
Expand Down

0 comments on commit a1b9757

Please sign in to comment.