Bug 1377965

Summary: atomic verify should raise an error if version of images is unavailable
Product: Red Hat Enterprise Linux 7 Reporter: Alex Jia <ajia>
Component: atomicAssignee: Brent Baude <bbaude>
Status: CLOSED CURRENTRELEASE QA Contact: atomic-bugs <atomic-bugs>
Severity: medium Docs Contact:
Priority: medium    
Version: 7.3CC: dwalsh, pthomas
Target Milestone: rcKeywords: Extras
Target Release: ---   
Hardware: x86_64   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2020-05-05 14:21:18 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:

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 ?