fix(applications): allow environment variable references in image tags

Closes #10642
This commit is contained in:
Andras Bacsai
2026-10-27 15:05:23 +01:00
parent d3b1a3d405
commit 4f9ad86e52
7 changed files with 109 additions and 19 deletions
+12
View File
@@ -139,3 +139,15 @@ it('correctly parses image when user provides digest-decorated name with colon h
->and($parser->getTag())->toBe($hash)
->and($parser->isImageHash())->toBeTrue();
});
it('parses a tag with a default value as one tag', function (string $imageString, string $imageName) {
$parser = new DockerImageParser;
$parser->parse($imageString);
expect($parser->getFullImageNameWithoutTag())->toBe($imageName)
->and($parser->getTag())->toBe('${API_VERSION:-latest}')
->and($parser->isImageHash())->toBeFalse();
})->with([
'image' => ['nginx:${API_VERSION:-latest}', 'nginx'],
'registry image with port' => ['localhost:5000/team/app:${API_VERSION:-latest}', 'localhost:5000/team/app'],
]);