fix(docker): match helper containers at any registry depth

This commit is contained in:
peaklabs-dev
2026-09-04 16:29:24 +02:00
parent b7f00e7267
commit aafef73aa6
2 changed files with 7 additions and 2 deletions
+1 -1
View File
@@ -21,7 +21,7 @@ class CleanupHelperContainersJob implements ShouldBeEncrypted, ShouldBeUnique, S
private static function helperContainersCommand(): string
{
return 'docker container ps --format \'{{json .}}\' | jq -s \'map(select(.Image|test("^([^/]+/)?coollabsio/coolify-helper(:|@)")))\'';
return 'docker container ps --format \'{{json .}}\' | jq -s \'map(select(.Image|test("(^|/)coollabsio/coolify-helper(:|@)")))\'';
}
public function handle(): void
@@ -13,6 +13,11 @@ it('matches helper image references without matching similarly named images', fu
'docker.io/coollabsio/coolify-helper:1.0.16',
'ghcr.io/coollabsio/coolify-helper@sha256:abc',
'registry.example/team/coollabsio/coolify-helper:latest',
'coollabsio/coolify:latest',
'coollabsio/coolify:4.3.12',
'coollabsio/coolify-realtime:1.0.10',
'coolify-helper:latest',
'someone/coolify-helper:1.0.16',
'evil/coollabsio/coolify-helper-copy:latest',
'coollabsio/not-coolify-helper:latest',
];
@@ -31,7 +36,7 @@ it('matches helper image references without matching similarly named images', fu
$process->mustRun();
expect(array_column(json_decode($process->getOutput(), true, flags: JSON_THROW_ON_ERROR), 'Image'))
->toBe(array_slice($images, 0, 3));
->toBe(array_slice($images, 0, 4));
} finally {
unlink($docker);
rmdir($directory);