Bug 1284869 - atomic migrate export command doesn't support deleting dangling image
atomic migrate export command doesn't support deleting dangling image
Product: Red Hat Enterprise Linux 7
Classification: Red Hat
Component: atomic (Show other bugs)
x86_64 Linux
unspecified Severity medium
: rc
: ---
Assigned To: smahajan@redhat.com
Depends On:
  Show dependency treegraph
Reported: 2015-11-24 06:18 EST by Alex Jia
Modified: 2016-03-31 19:25 EDT (History)
3 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2016-03-31 19:25:21 EDT
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)

  None (edit)
Description Alex Jia 2015-11-24 06:18:14 EST
Description of problem:
Atomic migrate command cann't deal with regular expressions, for example, for a dangling images, it will raise shell syntax error.

Version-Release number of selected component (if applicable):
# rpm -q docker atomic

# cat /etc/redhat-release 
Red Hat Enterprise Linux Server release 7.1 (Maipo)

How reproducible:

Steps to Reproduce:
1. build a image to generate a dangling image
2. run atomic migrate export

Actual results:
# atomic images
 REPOSITORY                          TAG                 IMAGE ID            CREATED             VIRTUAL SIZE
 registry.access.redhat.com/openshift3/ose latest              2eb816e9a7d0        2015-11-12 05:29    395.32 MB   
 docker-registry.usersys.redhat.com/baude/oscapd latest              69871a5c7067        2015-10-29 07:38    909.87 MB   
*<none>                              <none>              63b155fb8278        2015-10-27 16:13    1.11 MB 

# atomic migrate export
Exporting image with id: 2eb816e9a7d0
Exporting image with id: 63b155fb8278
/bin/sh: -c: line 0: syntax error near unexpected token `>'
/bin/sh: -c: line 0: `docker save <none>:<none> > /var/lib/atomic/migrate/images/63b155fb8278.tar'
<class 'subprocess.CalledProcessError'>

Expected results:
Fix it or doesn't support saving dangling image

Additional info:
Comment 1 Daniel Walsh 2015-11-24 11:35:50 EST
I don't think we should save dangling images.
Comment 2 Alex Jia 2015-11-24 22:07:27 EST
(In reply to Daniel Walsh from comment #1)
> I don't think we should save dangling images.

Yes, I think we have 2 ways to do this, the one is users must manually remove dangling images before migrating, and then it should be enough to document it in man page or help document; the other one is to let atomic migrate command more intelligent then can bypass or remove dangling images to do export, I tend to choose latter, it will be more convenient to migrate multiple docker containers own dangling images for users.
Comment 3 Daniel Walsh 2015-11-25 08:16:15 EST
Perhaps the tool could either exit with an error if their are dangling images, or prompt the user to ask permission to delete the <none><none>
Comment 4 Daniel Walsh 2016-01-06 14:17:02 EST
Shishir please comment.
Comment 5 smahajan@redhat.com 2016-01-06 14:21:44 EST
There was already a check to ignore dangling images (<none>:<none>) from getting exported. Let me check why it is not working.

Comment 6 smahajan@redhat.com 2016-01-15 14:15:46 EST
This is fixed in atomic master branch.
Closing this.

Comment 7 Daniel Walsh 2016-01-15 14:24:54 EST
You need to tell the version

Fixed in atomic-1.9.
Comment 9 Alex Jia 2016-01-20 23:09:21 EST
With atomic-1.8-4.git958d939.el7.x86_64, I can get a prompt information like this "There are dangling images in your system. Would you like atomic to prune them [y/N]" when migrating storage w/ dangling image, and it works well w/ 'y' and 'N' typing, so move the bug to VERIFIED status.
Comment 11 errata-xmlrpc 2016-03-31 19:25:21 EDT
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.


Note You need to log in before you can comment on or make changes to this bug.