@@ -409,11 +409,16 @@ func (r *OCIRepositoryReconciler) reconcileSource(ctx context.Context, obj *sour
409
409
}
410
410
}()
411
411
412
- // Verify artifact
412
+ // Verify artifact if:
413
+ // - the upstream digest differs from the one in storage (revision drift)
414
+ // - the OCIRepository spec has changed (generation drift)
415
+ // - the previous reconciliation resulted in a failed artifact verification (retry with exponential backoff)
413
416
if obj .Spec .Verify == nil {
414
417
// Remove old observations if verification was disabled
415
418
conditions .Delete (obj , sourcev1 .SourceVerifiedCondition )
416
- } else if ! obj .GetArtifact ().HasRevision (revision ) || conditions .GetObservedGeneration (obj , sourcev1 .SourceVerifiedCondition ) != obj .Generation {
419
+ } else if ! obj .GetArtifact ().HasRevision (revision ) ||
420
+ conditions .GetObservedGeneration (obj , sourcev1 .SourceVerifiedCondition ) != obj .Generation ||
421
+ conditions .IsFalse (obj , sourcev1 .SourceVerifiedCondition ) {
417
422
provider := obj .Spec .Verify .Provider
418
423
err := r .verifyOCISourceSignature (ctx , obj , url , keychain )
419
424
if err != nil {
@@ -422,7 +427,6 @@ func (r *OCIRepositoryReconciler) reconcileSource(ctx context.Context, obj *sour
422
427
sourcev1 .VerificationError ,
423
428
)
424
429
conditions .MarkFalse (obj , sourcev1 .SourceVerifiedCondition , e .Reason , e .Err .Error ())
425
- conditions .MarkFalse (obj , meta .ReconcilingCondition , e .Reason , e .Err .Error ())
426
430
return sreconcile .ResultEmpty , e
427
431
}
428
432
0 commit comments