diff options
author | Sascha Grunert <sgrunert@redhat.com> | 2022-06-30 10:05:44 +0200 |
---|---|---|
committer | Sascha Grunert <sgrunert@redhat.com> | 2022-06-30 12:58:57 +0200 |
commit | e8adec5f41388916b0f2206dc898a5587d51467c (patch) | |
tree | 856d4c6e84366560554bb91c5a0c33e0c0e29509 /cmd/podman/manifest | |
parent | 3426d56b92be2ac1c3cc62fc578e9cb6d64aca81 (diff) | |
download | podman-e8adec5f41388916b0f2206dc898a5587d51467c.tar.gz podman-e8adec5f41388916b0f2206dc898a5587d51467c.tar.bz2 podman-e8adec5f41388916b0f2206dc898a5587d51467c.zip |
cmd/podman: switch to golang native error wrapping
We now use the golang error wrapping format specifier `%w` instead of
the deprecated github.com/pkg/errors package.
Signed-off-by: Sascha Grunert <sgrunert@redhat.com>
Diffstat (limited to 'cmd/podman/manifest')
-rw-r--r-- | cmd/podman/manifest/push.go | 6 | ||||
-rw-r--r-- | cmd/podman/manifest/remove.go | 3 |
2 files changed, 4 insertions, 5 deletions
diff --git a/cmd/podman/manifest/push.go b/cmd/podman/manifest/push.go index b96a65c4a..9479e79a3 100644 --- a/cmd/podman/manifest/push.go +++ b/cmd/podman/manifest/push.go @@ -1,6 +1,7 @@ package manifest import ( + "fmt" "io/ioutil" "github.com/containers/common/pkg/auth" @@ -11,7 +12,6 @@ import ( "github.com/containers/podman/v4/cmd/podman/utils" "github.com/containers/podman/v4/pkg/domain/entities" "github.com/containers/podman/v4/pkg/util" - "github.com/pkg/errors" "github.com/spf13/cobra" ) @@ -88,10 +88,10 @@ func push(cmd *cobra.Command, args []string) error { listImageSpec := args[0] destSpec := args[1] if listImageSpec == "" { - return errors.Errorf(`invalid image name "%s"`, listImageSpec) + return fmt.Errorf(`invalid image name "%s"`, listImageSpec) } if destSpec == "" { - return errors.Errorf(`invalid destination "%s"`, destSpec) + return fmt.Errorf(`invalid destination "%s"`, destSpec) } if manifestPushOpts.CredentialsCLI != "" { diff --git a/cmd/podman/manifest/remove.go b/cmd/podman/manifest/remove.go index c32ffad78..4aa3b66b7 100644 --- a/cmd/podman/manifest/remove.go +++ b/cmd/podman/manifest/remove.go @@ -5,7 +5,6 @@ import ( "github.com/containers/podman/v4/cmd/podman/common" "github.com/containers/podman/v4/cmd/podman/registry" - "github.com/pkg/errors" "github.com/spf13/cobra" ) @@ -31,7 +30,7 @@ func init() { func remove(cmd *cobra.Command, args []string) error { updatedListID, err := registry.ImageEngine().ManifestRemoveDigest(registry.Context(), args[0], args[1]) if err != nil { - return errors.Wrapf(err, "error removing from manifest list %s", args[0]) + return fmt.Errorf("removing from manifest list %s: %w", args[0], err) } fmt.Println(updatedListID) return nil |