From 8816006d1e11e1a45ed2fdc4793ef48a444ed8e8 Mon Sep 17 00:00:00 2001 From: Derek McGowan Date: Fri, 7 Jan 2022 12:16:00 -0800 Subject: [PATCH] Fix followup items from errors replacement Signed-off-by: Derek McGowan --- mount/temp.go | 2 +- remotes/handlers.go | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/mount/temp.go b/mount/temp.go index 5ea82c8ec..13eedaf03 100644 --- a/mount/temp.go +++ b/mount/temp.go @@ -32,7 +32,7 @@ var tempMountLocation = getTempDir() func WithTempMount(ctx context.Context, mounts []Mount, f func(root string) error) (err error) { root, uerr := os.MkdirTemp(tempMountLocation, "containerd-mount") if uerr != nil { - return fmt.Errorf("failed to create temp dir: %w", err) + return fmt.Errorf("failed to create temp dir: %w", uerr) } // We use Remove here instead of RemoveAll. // The RemoveAll will delete the temp dir and all children it contains. diff --git a/remotes/handlers.go b/remotes/handlers.go index 9ec54209f..f03caf2bf 100644 --- a/remotes/handlers.go +++ b/remotes/handlers.go @@ -244,7 +244,7 @@ func PushContent(ctx context.Context, pusher Pusher, desc ocispec.Descriptor, st if (manifestStack[i].MediaType == ocispec.MediaTypeImageIndex || manifestStack[i].MediaType == images.MediaTypeDockerSchema2ManifestList) && errors.Unwrap(err) != nil && strings.Contains(errors.Unwrap(err).Error(), "400 Bad Request") { - return fmt.Errorf("manifest list/index references to blobs and/or manifests are missing in your target registry: %w ", err) + return fmt.Errorf("manifest list/index references to blobs and/or manifests are missing in your target registry: %w", err) } return err }