Skip to content
This repository has been archived by the owner on Apr 17, 2023. It is now read-only.

Fixed Registry synchronization with v2 manifests #725

Merged
merged 1 commit into from
Feb 11, 2016

Conversation

mssola
Copy link
Collaborator

@mssola mssola commented Feb 10, 2016

In the new manifest Version 2, schema 2; some fields are missing. In this case,
the "tag" field is no longer available as of this version. We used that because
the notification from the registry does not provide such information for now
(hopefully there will be a solution for Distribution 2.4). Thus, we pulled the
manifest and extracted the tag from there.

The code now detects the version of the manifest schema. If it's the latest
one, then we will fetch the tags of the given repo and compare them with what
we've got in the database.

Note that this solution could also be applied to the version 2 schema 1, but
fetching the manifest is faster and less prone to possible sync errors (even
though hese errors are not really important if crono is in place).

Moreover, I've added a table on the README.md file describing which versions of
Portus implement what.

Fixes #718

Signed-off-by: Miquel Sabaté Solà [email protected]

@mssola
Copy link
Collaborator Author

mssola commented Feb 10, 2016

This should be backported to the v2.0 branch. Moreover, the table that I've added in the README.md file should also be added into our gh-pages branch.

when "application/vnd.docker.distribution.manifest.v2+json",
"application/vnd.docker.distribution.manifest.list.v2+json"
get_tag_from_list(target["repository"])
else
Copy link
Member

Choose a reason for hiding this comment

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

Just an idea, can't we make a second case for manifest v2 schema 1 and then have the else block log an error. By doing that we would immediately notice when manifest v2 schema 3 is released.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Good idea.

@flavio
Copy link
Member

flavio commented Feb 11, 2016

LGTM, I think this should be backported to the v2 branch.

@mssola
Copy link
Collaborator Author

mssola commented Feb 11, 2016

I'll squash the commits once tests are passing.

In the new manifest Version 2, schema 2; some fields are missing. In this case,
the "tag" field is no longer available as of this version. We used that because
the notification from the registry does not provide such information for now
(hopefully there will be a solution for Distribution 2.4). Thus, we pulled the
manifest and extracted the tag from there.

The code now detects the version of the manifest schema. If it's the latest
one, then we will fetch the tags of the given repo and compare them with what
we've got in the database.

Note that this solution could also be applied to the version 2 schema 1, but
fetching the manifest is faster and less prone to possible sync errors (even
though hese errors are not really important if crono is in place).

Moreover, I've added a table on the README.md file describing which versions of
Portus implement what.

Fixes SUSE#718

Signed-off-by: Miquel Sabaté Solà <[email protected]>
mssola added a commit that referenced this pull request Feb 11, 2016
Fixed Registry synchronization with v2 manifests
@mssola mssola merged commit 98ff345 into SUSE:master Feb 11, 2016
@mssola mssola deleted the pushed-id branch February 11, 2016 10:52
@mssola
Copy link
Collaborator Author

mssola commented Feb 11, 2016

Backported into v2.0.

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.

2 participants