fix(lab): probe optional adapter image safely

This commit is contained in:
DCCONSTRUCTIONS
2026-08-31 19:52:34 +03:00
parent b2ae29b8d8
commit 142481f0d8
2 changed files with 11 additions and 3 deletions
@@ -132,9 +132,15 @@ function Install-ComponentImage {
}
$shortRevision = $SourceRevision.Substring(0, 12)
$tag = "ndc/mission-core-lab-v1-$Component-adapter:$shortRevision"
$existing = docker image inspect $tag 2>$null
if ($LASTEXITCODE -eq 0) {
$image = @($existing | ConvertFrom-Json)[0]
$existingId = docker image ls `
--quiet `
--no-trunc `
--filter "reference=$tag"
if ($LASTEXITCODE -ne 0) {
throw "LAB V1 component image lookup failed"
}
if ($existingId) {
$image = Get-ImageInspection $tag
$labels = $image.Config.Labels
if (
[string]$labels."org.opencontainers.image.revision" -cne $SourceRevision -or