Skip to content

Commit

Permalink
KIWI: Allow to extend cointainer name with profile
Browse files Browse the repository at this point in the history
This should be default, but changing the default would break existing
aggregates.

This has also a limitation that it only works properly when build just
one profile per build atm.
  • Loading branch information
adrianschroeter committed Jan 19, 2022
1 parent 57fbb8f commit d602ead
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions Build/Kiwi.pm
Original file line number Diff line number Diff line change
Expand Up @@ -246,6 +246,7 @@ sub kiwiparse {
$obsprofiles = [ grep {defined($_)} map {$_ eq '@BUILD_FLAVOR@' ? $buildflavor : $_} split(' ', $obsprofiles) ];
}
$unorderedrepos = 1 if $xml =~ /^\s*<!--\s+OBS-UnorderedRepos\s+-->\s*$/im;
$ret->{'appendprofiletocontainername'} = 1 if $xml =~ /^\s*<!--\s+OBS-AppendProfileToContainername\s+-->\s*$/im;
for ($xml =~ /^\s*<!--\s+OBS-Imagerepo:\s+(.*)\s+-->\s*$/img) {
push @imagerepos, { 'url' => $_ };
}
Expand Down Expand Up @@ -625,6 +626,10 @@ sub showcontainerinfo {
'buildtime' => $buildtime,
'_type' => {'buildtime' => 'number'},
};
if ($d->{'appendprofiletocontainername'} && @{$d->{'profiles'} || []}) {
# we can currently only handle one profile
$containerinfo->{'name'} .= "-$d->{'profiles'}->[0]";
}
$containerinfo->{'version'} = $d->{'version'} if defined $d->{'version'};
$containerinfo->{'release'} = $release if defined $release;
$containerinfo->{'tags'} = $d->{'container_tags'} if @{$d->{'container_tags'} || []};
Expand Down

0 comments on commit d602ead

Please sign in to comment.