Skip to content

return an image digest from DockerImageReference string - #785

Closed
sallyom wants to merge 1 commit into
openshift:masterfrom
sallyom:get-imagespec-digest
Closed

sallyom wants to merge 1 commit into
openshift:masterfrom
sallyom:get-imagespec-digest

Conversation

@sallyom

@sallyom sallyom commented Apr 23, 2020 •

Copy link
Copy Markdown
Contributor

I've found I need this for oc here: openshift/oc#395
This adds function to return an image digest from a string rather than going through a registry (to get the digest for tools from release payload mirrored from a registry you may not have access to in disconnected environments)
ie, this requires registry access: https://github.com/openshift/oc/blob/master/pkg/cli/admin/release/info.go#L675

@mfojtik

mfojtik commented Apr 24, 2020

Copy link
Copy Markdown
Contributor

/assign @dmage

Comment thread pkg/image/reference/reference.go Resolved
Comment thread pkg/image/reference/reference.go Resolved
@sallyom
sallyom force-pushed the get-imagespec-digest branch 2 times, most recently from 3617fff to af2fa04 Compare April 24, 2020 13:50
@dmage

dmage commented Apr 24, 2020

Copy link
Copy Markdown
Contributor

/lgtm

@openshift-ci-robot openshift-ci-robot added the lgtm Indicates that a PR is ready to be merged. label Apr 24, 2020
@openshift-ci-robot

Copy link
Copy Markdown

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: dmage, sallyom
To complete the pull request process, please assign smarterclayton
You can assign the PR to them by writing /assign @smarterclayton in a comment when ready.

The full list of commands accepted by this bot can be found here.

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@sallyom
sallyom force-pushed the get-imagespec-digest branch from af2fa04 to 45b3644 Compare April 30, 2020 20:37
@openshift-ci-robot openshift-ci-robot removed the lgtm Indicates that a PR is ready to be merged. label Apr 30, 2020
@openshift-ci-robot

Copy link
Copy Markdown

New changes are detected. LGTM label has been removed.

@sallyom

sallyom commented May 1, 2020

Copy link
Copy Markdown
Contributor Author

/retest


// GetSpecDigest returns the image digest from a DockerImageReference string.
// example 'sha:22204fa2...' in an image 'registry/ocp/release@sha:22204fa2...'
func GetSpecDigest(spec string) (string, error) {

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Why this is needed when we can use Parse and then read resulting ref.ID?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

correct, closing this lol

@sallyom

sallyom commented May 4, 2020

Copy link
Copy Markdown
Contributor Author

this is not needed see above comment, closing

@sallyom sallyom closed this May 4, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants