Skip to content

Commit

Permalink
Merge pull request #9934 from mlschroe/master
Browse files Browse the repository at this point in the history
[backend] support oci content types in bs_regpush -l
  • Loading branch information
mlschroe committed Jul 21, 2020
2 parents b6433cc + 2775bab commit 13405cc
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/backend/bs_regpush
Original file line number Diff line number Diff line change
Expand Up @@ -190,7 +190,7 @@ sub manifest_upload {
return $maniid if manifest_exists($manifest, $tag, $content_type);
$content_type ||= 'application/vnd.docker.distribution.manifest.v2+json';
my $fat = '';
$fat = 'fat ' if $content_type eq 'application/vnd.docker.distribution.manifest.list.v2+json';
$fat = 'fat ' if $content_type eq 'application/vnd.docker.distribution.manifest.list.v2+json' || $content_type eq 'application/vnd.oci.image.index.v1+json';
if (!$quiet) {
if (defined($tag)) {
print "uploading ${fat}manifest $maniid for tag '$tag'... ";
Expand Down Expand Up @@ -283,7 +283,7 @@ sub get_manifest_for_tag {
my $replyheaders;
my $param = {
'uri' => "$registryserver/v2/$repository/manifests/$tag",
'headers' => [ "Accept: application/vnd.docker.distribution.manifest.list.v2+json, application/vnd.docker.distribution.manifest.v2+json" ],
'headers' => [ "Accept: application/vnd.docker.distribution.manifest.list.v2+json, application/vnd.docker.distribution.manifest.v2+json, application/vnd.oci.image.manifest.v1+json, application/vnd.oci.image.index.v1+json" ],
'authenticator' => $registry_authenticator,
'replyheaders' => \$replyheaders,
'timeout' => $registry_timeout,
Expand Down Expand Up @@ -340,6 +340,10 @@ sub list_tag {
printf "%-20s %s %s\n", $tag, $maniid, 'list';
} elsif ($mani->{'mediaType'} eq 'application/vnd.docker.distribution.manifest.v2+json') {
printf "%-20s %s %s\n", $tag, $maniid, 'image';
} elsif ($mani->{'mediaType'} eq 'application/vnd.oci.image.manifest.v1+json') {
printf "%-20s %s %s\n", $tag, $maniid, 'ociimage';
} elsif ($mani->{'mediaType'} eq 'application/vnd.oci.image.index.v1+json') {
printf "%-20s %s %s\n", $tag, $maniid, 'ocilist';
} else {
printf "%-20s %s %s\n", $tag, $maniid, 'unknown';
}
Expand Down

0 comments on commit 13405cc

Please sign in to comment.