Skip to content
This repository was archived by the owner on Oct 10, 2020. It is now read-only.

[merged] Introduce registry inspect methods#687

Closed
baude wants to merge 1 commit intoprojectatomic:masterfrom
baude:inspect
Closed

[merged] Introduce registry inspect methods#687
baude wants to merge 1 commit intoprojectatomic:masterfrom
baude:inspect

Conversation

@baude
Copy link
Member

@baude baude commented Oct 7, 2016

Add two classes and several new methods for inspecting
registries and images. These methods are helpful
for:

  • taking user input (i.e. image names, partial image names) and determining
    the fully qualified names.
  • determining the fq name when the registry is omitted by the user.
  • obtaining image manifests
  • mimicing skopeo inspect

raise ValueError('Error parsing input: "{}" invalid'.format(input_image))
if all([True if x else False for x in [registry, repo, image, tag]]):
return input_image
if all([True if x else False for x in [registry, image, tag]]):
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why do the first one? Doing just this block should be enough?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yup! Fixed.

@rhatdan
Copy link
Member

rhatdan commented Oct 7, 2016

@runcom PTAL. Since he is doing some of the stuff skopeo does for remote viewing...

@rhatdan
Copy link
Member

rhatdan commented Oct 7, 2016

Are you handling the case where there are multiple registires?

atomic pull rhel7tools

Does this work there?



class TestAtomicUtil(unittest.TestCase):
IMAGE = 'docker.io/library/busybox:latest'
Copy link
Contributor

@runcom runcom Oct 7, 2016

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is util.decompose working with a digest also? e.g. docker.io/library/busybox@sha256:%HEX%

@runcom
Copy link
Contributor

runcom commented Oct 7, 2016

patch LGTM

Are you handling the case where there are multiple registires?

atomic pull rhel7tools

Does this work there?

The loop over the available registries in docker should be here https://github.com/projectatomic/atomic/pull/687/files#diff-1e7bfb73126e6f7e89b71bbe478132d3R249 right Brent?

@baude
Copy link
Member Author

baude commented Oct 7, 2016

yeah that is the loop. I was trying to understand if that is what @rhatdan wanted or something different. thanks for the review @runcom

@rhatdan
Copy link
Member

rhatdan commented Oct 7, 2016

Right as long as rhel7tools ends up being something like
redhat-registry.redhat.com/rhel7tools:latest

I am fine with this patch.

Add two classes and several new methods for inspecting
registries and images.  These methods are helpful
for:

* taking user input (i.e. image names, partial image names) and determining
the fully qualified names.
* determining the fq name when the registry is omitted by the user.
* obtaining image manifests
* mimicing skopeo inspect
@baude
Copy link
Member Author

baude commented Oct 7, 2016

Current output for this looks like:

[bbaude@localhost atomic (inspect)]$ sudo ./atomic pull rhel7
Image rhel7 is being pulled to docker ...
Trying docker.io/library/rhel7:latest
Trying registry.access.redhat.com/rhel7:latest
Pulling registry.access.redhat.com/rhel7:latest ...
Getting image source manifest
Getting image source configuration
Uploading blob sha256:30cf2e26a24f2a8426cbe8444f8af2ecb7023bd468b05c1b6fd0b2797b0f9ff9
 5.97 MB / ? [-----------------------------

@baude
Copy link
Member Author

baude commented Oct 7, 2016

At the risk of merging my own code ... but doing so to unblock CAHC

@rh-atomic-bot r+

@rh-atomic-bot
Copy link

📌 Commit 4fc217e has been approved by baude

@rh-atomic-bot
Copy link

⌛ Testing commit 4fc217e with merge aa59a5e...

from urllib2 import parse_http_list, parse_keqv_list #pylint: disable=import-error


def jose_base64_urldecode(in_str):
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Who's "jose"? 😄 Did this code come from somewhere else?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@cgwalters it mimics some golang code

@rh-atomic-bot
Copy link

☀️ Test successful - status-atomicjenkins
Approved by: baude
Pushing aa59a5e to master...

@rh-atomic-bot rh-atomic-bot changed the title Introduce registry inspect methods [merged] Introduce registry inspect methods Oct 7, 2016
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants