diff options
author | Daniel J Walsh <dwalsh@redhat.com> | 2022-09-10 07:40:39 -0400 |
---|---|---|
committer | Daniel J Walsh <dwalsh@redhat.com> | 2022-09-10 07:52:00 -0400 |
commit | 2c63b8439bbdc09203ea394ad2cf9352830861f0 (patch) | |
tree | 39b9d8d061bc248e4dbeb6445c2ad0c99b048ae1 /pkg/domain/infra/abi/manifest.go | |
parent | 2d8417d86a7edf11bce5527f311bb951a651d40e (diff) | |
download | podman-2c63b8439bbdc09203ea394ad2cf9352830861f0.tar.gz podman-2c63b8439bbdc09203ea394ad2cf9352830861f0.tar.bz2 podman-2c63b8439bbdc09203ea394ad2cf9352830861f0.zip |
Fix stutters
Podman adds an Error: to every error message. So starting an error
message with "error" ends up being reported to the user as
Error: error ...
This patch removes the stutter.
Also ioutil.ReadFile errors report the Path, so wrapping the err message
with the path causes a stutter.
Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
Diffstat (limited to 'pkg/domain/infra/abi/manifest.go')
-rw-r--r-- | pkg/domain/infra/abi/manifest.go | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/pkg/domain/infra/abi/manifest.go b/pkg/domain/infra/abi/manifest.go index 7e8c86526..ac3eedbe8 100644 --- a/pkg/domain/infra/abi/manifest.go +++ b/pkg/domain/infra/abi/manifest.go @@ -95,7 +95,7 @@ func (ir *ImageEngine) ManifestInspect(ctx context.Context, name string) ([]byte var b bytes.Buffer if err := json.Indent(&b, rawSchema2List, "", " "); err != nil { - return nil, fmt.Errorf("error rendering manifest %s for display: %w", name, err) + return nil, fmt.Errorf("rendering manifest %s for display: %w", name, err) } return b.Bytes(), nil } @@ -158,7 +158,7 @@ func (ir *ImageEngine) remoteManifestInspect(ctx context.Context, name string) ( logrus.Warnf("The manifest type %s is not a manifest list but a single image.", manType) schema2Manifest, err := manifest.Schema2FromManifest(result) if err != nil { - return nil, fmt.Errorf("error parsing manifest blob %q as a %q: %w", string(result), manType, err) + return nil, fmt.Errorf("parsing manifest blob %q as a %q: %w", string(result), manType, err) } if result, err = schema2Manifest.Serialize(); err != nil { return nil, err @@ -166,7 +166,7 @@ func (ir *ImageEngine) remoteManifestInspect(ctx context.Context, name string) ( default: listBlob, err := manifest.ListFromBlob(result, manType) if err != nil { - return nil, fmt.Errorf("error parsing manifest blob %q as a %q: %w", string(result), manType, err) + return nil, fmt.Errorf("parsing manifest blob %q as a %q: %w", string(result), manType, err) } list, err := listBlob.ConvertToMIMEType(manifest.DockerV2ListMediaType) if err != nil { @@ -178,7 +178,7 @@ func (ir *ImageEngine) remoteManifestInspect(ctx context.Context, name string) ( } if err = json.Indent(&b, result, "", " "); err != nil { - return nil, fmt.Errorf("error rendering manifest %s for display: %w", name, err) + return nil, fmt.Errorf("rendering manifest %s for display: %w", name, err) } return b.Bytes(), nil } @@ -301,7 +301,7 @@ func (ir *ImageEngine) ManifestRm(ctx context.Context, names []string) (report * func (ir *ImageEngine) ManifestPush(ctx context.Context, name, destination string, opts entities.ImagePushOptions) (string, error) { manifestList, err := ir.Libpod.LibimageRuntime().LookupManifestList(name) if err != nil { - return "", fmt.Errorf("error retrieving local image from image name %s: %w", name, err) + return "", fmt.Errorf("retrieving local image from image name %s: %w", name, err) } var manifestType string @@ -362,7 +362,7 @@ func (ir *ImageEngine) ManifestPush(ctx context.Context, name, destination strin if opts.Rm { rmOpts := &libimage.RemoveImagesOptions{LookupManifest: true} if _, rmErrors := ir.Libpod.LibimageRuntime().RemoveImages(ctx, []string{manifestList.ID()}, rmOpts); len(rmErrors) > 0 { - return "", fmt.Errorf("error removing manifest after push: %w", rmErrors[0]) + return "", fmt.Errorf("removing manifest after push: %w", rmErrors[0]) } } |