Bug 1688041

Summary: podman image save removes existing image
Product: Red Hat Enterprise Linux 8 Reporter: Pavel Sedlák <psedlak>
Component: podmanAssignee: Qi Wang <qiwan>
Status: CLOSED WONTFIX QA Contact: atomic-bugs <atomic-bugs>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 8.0CC: dwalsh, jligon, lsm5, mheon, qiwan
Target Milestone: rc   
Target Release: 8.1   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: podman-1.4.4 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2021-02-01 07:39:27 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Pavel Sedlák 2019-03-13 00:48:10 UTC
Description of problem:
When attempting to export image content into file, when destination file (specified by -o) already exists, podman refuses the operation and informs that it cannot modify existing image.
But at the same time it erases the destination file.

Version-Release number of selected component (if applicable):
> podman-1.0.0-2.git921f98f.module+el8+2785+ff8a053f.x86_64

How reproducible: always

Steps to Reproduce:

> [root@undercloud-0 img.d]# podman image save -o /tmp/img 192.168.24.1:8787/rhosp15/openstack-glance-api:20190311.1
> Getting image source signatures
> Copying blob 6dc95b5438fb: 205.77 MiB / 205.77 MiB [========================] 8s
> Copying blob 569f57f28708: 10.00 KiB / 10.00 KiB [==========================] 8s
> Copying blob c05daf4fbb45: 125.41 MiB / 125.41 MiB [========================] 8s
> Copying blob c315e7e9e481: 240.77 MiB / 240.77 MiB [========================] 8s
> Copying blob 68a4db334ec4: 215.90 MiB / 215.90 MiB [========================] 8s
> Copying blob e471e2366f03: 44.67 MiB / 44.67 MiB [==========================] 8s
> Copying config e3527fa677a4: 4.18 KiB / 4.18 KiB [==========================] 0s
> Writing manifest to image destination
> Storing signatures
> [root@undercloud-0 img.d]# ll /tmp/img
> -rw-r--r--. 1 root root 873000960 Mar 13 00:44 /tmp/img
> [root@undercloud-0 img.d]# podman image save -o /tmp/img 192.168.24.1:8787/rhosp15/openstack-glance-api:20190311.1
> unable to save ["192.168.24.1:8787/rhosp15/openstack-glance-api:20190311.1"]: Error copying image to the remote destination: Error initializing destination docker-archive:/tmp/img:192.168.24.1:8787/rhosp15/openstack-glance-api:20190311.1: docker-archive doesn't support modifying existing images
> [root@undercloud-0 img.d]# ll /tmp/img
> ls: cannot access '/tmp/img': No such file or directory


Actual results:
After podman rejects to modify the existing image, image is also removed.

Expected results:
After podman rejects to modify the existing image, image stays in place without modifications.


Additional info:

Comment 1 Qi Wang 2019-03-13 15:57:10 UTC
I received this bug. (test my bugzilla account)

Comment 3 Qi Wang 2019-08-14 14:27:24 UTC
Yes. PR has been merged. https://github.com/containers/libpod/pull/2720

Comment 6 RHEL Program Management 2021-02-01 07:39:27 UTC
After evaluating this issue, there are no plans to address it further or fix it in an upcoming release.  Therefore, it is being closed.  If plans change such that this issue will be fixed in an upcoming release, then the bug can be reopened.