Skip to content

Commit 7e12aa7

Browse files
committed
add oras discover call to retrieve attached annotation
1 parent a533587 commit 7e12aa7

File tree

1 file changed

+10
-0
lines changed
  • EV2Specs/ServiceGroupRoot/Shell/Run

1 file changed

+10
-0
lines changed

EV2Specs/ServiceGroupRoot/Shell/Run/Run.ps1

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -188,6 +188,16 @@ try {
188188
Write-Verbose -Verbose "oras attach --artifact-type `"application/vnd.microsoft.artifact.lifecycle`" --annotation `"vnd.microsoft.artifact.lifecycle.end-of-life.date=$endOfLifeDate`" $acrImageNameDigest"
189189
}
190190

191+
if (!$whatIf)
192+
{
193+
$imageAnnotation = oras discover --format json --artifact-type "application/vnd.microsoft.artifact.lifecycle" $acrImageNameDigest
194+
$imageAnnotationJson = $imageAnnotation | ConvertFrom-Json
195+
$eolDateAttached = $imageAnnotationJson.manifests.annotations."vnd.microsoft.artifact.lifecycle.end-of-life.date".ToString("yyyy-MM-ddTHH:mm:00Z")
196+
Write-Verbose -Verbose "date attached: $endOfLifeDate, date found in annotation: $eolDateAttached, match: $($eolDateAttached -eq $endOfLifeDate)"
197+
}
198+
else {
199+
Write-Verbose -Verbose "oras discover --format json --artifact-type `"application/vnd.microsoft.artifact.lifecycle`" $acrImageNameDigest"
200+
}
191201
}
192202

193203
# Need to push image for each tag

0 commit comments

Comments
 (0)