forked from kwk/docker-registry-frontend
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Update Manifest query to handle both schema versions
The Manifest API will return information about the image or tag. This information is stored in a schema, that schema has two versions. For older Docker clients/ registries the v1 schema is returned by default; however, newer registries can return either v1 or v2. The API requires that you set a header to tell it which schema version you want. PR kwk#101 added the use of the Manifest API so we can show the Dockerfile, and size, and labels, etc. It is setting the header of the request so that we get the v2 version of the schema however it is parsing/expecting the V1 version of the schema. If we are using an older registry (i.e. 2.1.1) then this works because the header is ignored and only the V1 is returned; however, if using a newer version (i.e. 2.6.2) the v2 schema would be returned and not parsed correctly. PR kwk#168 modifies the use of the Manifest API so that it _does_ parse/expect the V2 schema; however, that means that the app will no longer work in older registries (or for images pushed by older clients) as it no longer supportes the V1 schema. This change set merged these two PRs together by checking the content type header in the response to figure out which version the registry returned. It then parses the payload depending on the schema version. With this change the user gets a very similar experance regardless of the manifest schema version being returned. Note: There is likly room for performance improvments here, I plan on a larger refactor and will like to address the ineffeciencies their
- Loading branch information
Brad van der Laan
committed
Jun 14, 2018
1 parent
c144a1d
commit ca0c5c0
Showing
4 changed files
with
225 additions
and
111 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.