fix(lab): probe optional adapter image safely
This commit is contained in:
+9
-3
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user