Merge pull request #2720 from QiWang19/save

fix Bug 1688041-podman image save removes existing image
This commit is contained in:
OpenShift Merge Robot 2019-03-21 04:59:01 -07:00 committed by GitHub
commit 97b966b851
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -1152,9 +1152,6 @@ func (i *Image) Save(ctx context.Context, source, format, output string, moreTag
}
}
if err := i.PushImageToReference(ctx, destRef, manifestType, "", "", writer, compress, SigningOptions{}, &DockerRegistryOptions{}, additionaltags); err != nil {
if err2 := os.Remove(output); err2 != nil {
logrus.Errorf("error deleting %q: %v", output, err)
}
return errors.Wrapf(err, "unable to save %q", source)
}
defer i.newImageEvent(events.Save)