Skip to content

Commit

Permalink
[backend] publisher: also add trust hint if we have a local registry …
Browse files Browse the repository at this point in the history
…with TUF data
  • Loading branch information
mlschroe committed Sep 27, 2018
1 parent 7706a78 commit d96629b
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/backend/BSPublisher/Container.pm
Expand Up @@ -157,6 +157,7 @@ sub upload_all_containers {
}

my $notary_uploads = {};
my $have_some_trust;
my @registries = registries_for_prp($projid, $repoid);

my %allrefs;
Expand Down Expand Up @@ -197,7 +198,8 @@ sub upload_all_containers {
$gun .= "/$repository";
undef $gun unless defined $pubkey;
}
do_local_uploads($extrep, $projid, $repoid, $repository, $gun, $containers, $pubkey, $signargs, $multicontainer, $uptags);
$have_some_trust = 1 if $gun;
do_local_uploads($extrep, $projid, $repoid, $repository, $gun, $containers, $pubkey, $signargs, $multicontainer, $uptags);
my $pullserver = $registry->{'server'};
undef $pullserver if $pullserver && $pullserver eq 'local:';
if ($pullserver) {
Expand Down Expand Up @@ -246,6 +248,7 @@ sub upload_all_containers {
delete_obsolete_tags_from_registry($registry, $repository, $containerdigests);
}
}
$have_some_trust = 1 if %$notary_uploads;

# postprocessing: write readme, create links
my %allrefs_pp;
Expand All @@ -266,7 +269,7 @@ sub upload_all_containers {
my @r = sort(BSUtil::unify(@{$allrefs_pp{$pp}}));
my $readme = "This container can be pulled via:\n";
$readme .= " docker pull $_\n" for @r;
$readme .= "\nSet DOCKER_CONTENT_TRUST=1 to enable image tag verification.\n" if %{$notary_uploads || {}};
$readme .= "\nSet DOCKER_CONTENT_TRUST=1 to enable image tag verification.\n" if $have_some_trust;
writestr("$extrep/$pp.registry.txt", undef, $readme);
} elsif ($multicontainer && $allrefs_pp_lastp{$pp} ne $pp) {
# create symlink to last arch
Expand Down

0 comments on commit d96629b

Please sign in to comment.