Bug 1377965 - atomic verify should raise an error if version of images is unavailable
Summary: atomic verify should raise an error if version of images is unavailable
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: Red Hat Enterprise Linux 7
Classification: Red Hat
Component: atomic
Version: 7.3
Hardware: x86_64
OS: Linux
medium
medium
Target Milestone: rc
: ---
Assignee: Brent Baude
QA Contact: atomic-bugs@redhat.com
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2016-09-21 08:01 UTC by Alex Jia
Modified: 2020-05-05 14:21 UTC (History)
2 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2020-05-05 14:21:18 UTC
Target Upstream Version:


Attachments (Terms of Use)

Description Alex Jia 2016-09-21 08:01:48 UTC
Description of problem:
atomic verify should raise an error instead of appending 'Version unavailable' to output of command if version of images is unavailable.

Version-Release number of selected component (if applicable):

[cloud-user@atomic-host-001 ~]$ cat /etc/redhat-release 
Red Hat Enterprise Linux Atomic Host release 7.2

[cloud-user@atomic-host-001 ~]$ atomic host status
State: idle
Deployments:
● rhel-atomic-host-ostree:rhel-atomic-host/7/x86_64/standard
       Version: 7.2.6-1 (2016-08-18 16:01:03)
        Commit: dae35767902aad07b087d359be20f234d244da79fdd4734cd2fbc3ee39b12cf8
        OSName: rhel-atomic-host
  GPGSignature: (unsigned)
      Unlocked: development


[cloud-user@atomic-host-001 ~]$ rpm -q atomic
atomic-1.12.3-2.el7.x86_64

How reproducible:
always

Steps to Reproduce:
1. sudo docker pull busybox
2. sudo atomic verify -v busybox


Actual results:

[cloud-user@atomic-host-001 ~]$ sudo docker pull busybox
Using default tag: latest
Trying to pull repository registry.access.redhat.com/busybox ... 
unknown: Not Found
Trying to pull repository docker.io/library/busybox ... 
latest: Pulling from docker.io/library/busybox
8ddc19f16526: Pull complete 
Digest: sha256:a59906e33509d14c036c8678d687bd4eec81ed7c4b8ce907b888c607f6a1e0e6
Status: Downloaded newer image for docker.io/busybox:latest

[cloud-user@atomic-host-001 ~]$ sudo docker images
REPOSITORY          TAG                 IMAGE ID            CREATED             SIZE
docker.io/busybox   latest              2b8fd9751c4c        12 weeks ago        1.093 MB

[cloud-user@atomic-host-001 ~]$ sudo atomic --debug verify -v --no-validate busybox
{
    "index": 0,
    "Version": "",
    "Name": "docker.io/busybox:latest",
    "Parent": "",
    "Tag": "docker.io/busybox:latest",
    "Id": "2b8fd9751c4c0f5dd266fcae00707e67a2545ef34f9a29354585f93dac906749"
}
{
    "iid": "2b8fd9751c4c0f5dd266fcae00707e67a2545ef34f9a29354585f93dac906749",
    "tag": "docker.io/busybox:latest",
    "remote": false,
    "name": "docker.io/busybox:latest",
    "index": 0,
    "latest_nvr": "docker.io/busybox:latest-Version unavailable",
    "local_nvr": "docker.io/busybox:latest-Version unavailable",
    "no_version": false
}

docker.io/busybox:latest contains the following images:

     Local Version                                Latest Version                                
     -------------                                --------------                                
     docker.io/busybox:latest-Version unavailable docker.io/busybox:latest-Version unavailable  

     * = version difference


Expected results:


Additional info:

if the version of image is unavailable, it means we can't compare them, so I think we should raise an error other than joining string "docker.io/busybox:latest-" and "Version unavailable" to output.

Comment 2 Brent Baude 2016-10-10 17:33:48 UTC
@dwalsh, what do you think about this? is that your preferred approach as well ?

Comment 3 Daniel Walsh 2016-10-10 17:48:49 UTC
I am fine with raising an exception on this case.

Comment 4 Brent Baude 2017-02-04 17:11:42 UTC
If an image does not have version information, we currently compare the image ids.

[bbaude@bbaude atomic (master)]$ sudo ./atomic images verify -v docker.io/busybox:latest

docker.io/busybox:latest contains the following images:

NAME                           LOCAL VERSION        REMOTE VERSION       DIFFERS
busybox                        7968321274dc6b617169 7968321274dc6b617169 NO

Does that sufficiently cover the concerns in this bugzilla?

Comment 5 Alex Jia 2017-02-07 02:47:57 UTC
(In reply to Brent Baude from comment #4)
> If an image does not have version information, we currently compare the
> image ids.
> 
> [bbaude@bbaude atomic (master)]$ sudo ./atomic images verify -v
> docker.io/busybox:latest
> 
> docker.io/busybox:latest contains the following images:
> 
> NAME                           LOCAL VERSION        REMOTE VERSION      
> DIFFERS
> busybox                        7968321274dc6b617169 7968321274dc6b617169 NO
> 
> Does that sufficiently cover the concerns in this bugzilla?

Yes, it should be enough to this case I think, thanks.

Comment 6 Brent Baude 2017-02-28 15:15:23 UTC
should we move this bug to some other state ?


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