Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add image utils to gather metadata #9915

Merged
merged 2 commits into from
Mar 26, 2019
Merged

Conversation

dhashrath-msft
Copy link
Contributor

No description provided.

namespace = namespace ? namespace + '/' : '';

return "https://" + registry + namespace + repository + "@sha256:" + digest;
Copy link
Contributor

Choose a reason for hiding this comment

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

If namespace is non-empty, while repository is empty string, In that case return value would be ".....namespace/@sha256....". Having "/@" in continuation does not seem correct


export function getResourceName(image: string, digest: string) {
var match = image.match(/^(?:([^\/]+)\/)?(?:([^\/]+)\/)?([^@:\/]+)(?:[@:](.+))?$/);
Copy link
Contributor

Choose a reason for hiding this comment

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

can u please add a comment around this regex?

var namespace = match[2];
var repository = match[3];
var tag = match[4];
Copy link
Contributor

Choose a reason for hiding this comment

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

We are not using tags in resource url. Do we need this here?

@dhashrath-msft dhashrath-msft merged commit f52d1ee into master Mar 26, 2019
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.

3 participants