@@ -387,10 +387,8 @@ func verifyAnnotations(t *testing.T, patchedRef string, platforms []string, repo
387
387
err = json .Unmarshal (out , & manifest )
388
388
require .NoError (t , err , "failed to parse manifest JSON" )
389
389
390
- // Check index-level annotations (Copa metadata)
390
+ // Check index-level annotations
391
391
assert .NotEmpty (t , manifest .Annotations , "index-level annotations should not be empty" )
392
- assert .Equal (t , "true" , manifest .Annotations ["sh.copa.patched" ], "should have Copa patched annotation" )
393
- assert .NotEmpty (t , manifest .Annotations ["sh.copa.patched.timestamp" ], "should have Copa timestamp annotation" )
394
392
assert .NotEmpty (t , manifest .Annotations ["org.opencontainers.image.created" ], "should have created annotation" )
395
393
396
394
t .Logf ("found %d index-level annotations" , len (manifest .Annotations ))
@@ -411,6 +409,12 @@ func verifyAnnotations(t *testing.T, patchedRef string, platforms []string, repo
411
409
t .Logf ("platform %s has updated created timestamp: %s" , platformStr , createdTime )
412
410
}
413
411
412
+ // Check for Copa last.patched annotation on patched platforms
413
+ lastPatched , exists := manifestEntry .Annotations ["sh.copa.last.patched" ]
414
+ assert .True (t , exists , "patched platform %s should have sh.copa.last.patched annotation" , platformStr )
415
+ assert .NotEmpty (t , lastPatched , "sh.copa.last.patched timestamp should not be empty for patched platform %s" , platformStr )
416
+ t .Logf ("platform %s has Copa last.patched timestamp: %s" , platformStr , lastPatched )
417
+
414
418
t .Logf ("platform %s has %d manifest-level annotations" , platformStr , len (manifestEntry .Annotations ))
415
419
416
420
// Verify that ALL original annotations are preserved
@@ -446,7 +450,11 @@ func verifyAnnotations(t *testing.T, patchedRef string, platforms []string, repo
446
450
447
451
t .Logf ("verified %d original annotations are preserved for platform %s" , len (originalAnnotations ), platformStr )
448
452
} else {
449
- t .Logf ("skipping platform %s (no vulnerability report, not patched)" , platformStr )
453
+ t .Logf ("checking platform %s (no vulnerability report, not patched)" , platformStr )
454
+
455
+ // Non-patched platforms should NOT have the Copa last.patched annotation
456
+ _ , exists := manifestEntry .Annotations ["sh.copa.last.patched" ]
457
+ assert .False (t , exists , "non-patched platform %s should not have sh.copa.last.patched annotation" , platformStr )
450
458
}
451
459
}
452
460
}
0 commit comments