Skip to content

Commit

Permalink
Merge pull request #763 from adrianschroeter/appendtocontainer
Browse files Browse the repository at this point in the history
KIWI: Allow to extend cointainer name with profile
  • Loading branch information
mlschroe committed Jan 19, 2022
2 parents 57fbb8f + d602ead commit 1f7008c
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 1f7008c

Please sign in to comment.