Skip to content

Commit

Permalink
Fix container image version number processing
Browse files Browse the repository at this point in the history
  • Loading branch information
0xEAB committed Aug 6, 2024
1 parent b2f079c commit debcade
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 3 deletions.
10 changes: 7 additions & 3 deletions tools/ddct-src/Datatype/ContainerVersionTag.php
Original file line number Diff line number Diff line change
Expand Up @@ -199,10 +199,14 @@ private static function parseSemantic(string $input, bool $lax): ?SemVer
return null;
}

$major = ($matches['major'] === null) ? null : (int)$matches['major'];
$minor = ($matches['minor'] === null) ? null : (int)$matches['minor'];
$patch = ($matches['patch'] === null) ? null : (int)$matches['patch'];

return new SemVer(
(int)$matches['major'],
(int)$matches['minor'],
(int)$matches['patch'],
$major,
$minor,
$patch,
$matches['prerelease'] ?? null,
);
}
Expand Down
3 changes: 3 additions & 0 deletions tools/ddct-src/Util/ContainerBuilder.php
Original file line number Diff line number Diff line change
Expand Up @@ -132,6 +132,9 @@ public function hasBuiltExact(string $app, ContainerVersionTag $version): ?Conta
if ($imageVersion === null) {
continue;
}
if (!$imageVersion->isFullVersionNumber()) {
continue;
}

$diff = ContainerVersionTag::compare($imageVersion, $version);
if ($diff === 0) {
Expand Down

0 comments on commit debcade

Please sign in to comment.