Fix followup items from errors replacement

Signed-off-by: Derek McGowan <derek@mcg.dev>
This commit is contained in:
Derek McGowan 2022-01-07 12:16:00 -08:00
parent 77d53d2d23
commit 8816006d1e
No known key found for this signature in database
GPG Key ID: F58C5D0A4405ACDB
2 changed files with 2 additions and 2 deletions

View File

@ -32,7 +32,7 @@ var tempMountLocation = getTempDir()
func WithTempMount(ctx context.Context, mounts []Mount, f func(root string) error) (err error) { func WithTempMount(ctx context.Context, mounts []Mount, f func(root string) error) (err error) {
root, uerr := os.MkdirTemp(tempMountLocation, "containerd-mount") root, uerr := os.MkdirTemp(tempMountLocation, "containerd-mount")
if uerr != nil { 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. // We use Remove here instead of RemoveAll.
// The RemoveAll will delete the temp dir and all children it contains. // The RemoveAll will delete the temp dir and all children it contains.

View File

@ -244,7 +244,7 @@ func PushContent(ctx context.Context, pusher Pusher, desc ocispec.Descriptor, st
if (manifestStack[i].MediaType == ocispec.MediaTypeImageIndex || if (manifestStack[i].MediaType == ocispec.MediaTypeImageIndex ||
manifestStack[i].MediaType == images.MediaTypeDockerSchema2ManifestList) && manifestStack[i].MediaType == images.MediaTypeDockerSchema2ManifestList) &&
errors.Unwrap(err) != nil && strings.Contains(errors.Unwrap(err).Error(), "400 Bad Request") { 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 return err
} }