diff --git a/internal/controller/ocirepository_controller.go b/internal/controller/ocirepository_controller.go index 3d8a2c526..bff7da0b5 100644 --- a/internal/controller/ocirepository_controller.go +++ b/internal/controller/ocirepository_controller.go @@ -408,7 +408,7 @@ func (r *OCIRepositoryReconciler) reconcileSource(ctx context.Context, sp *patch // Mark observations about the revision on the object defer func() { if !obj.GetArtifact().HasRevision(revision) { - message := fmt.Sprintf("new revision '%s' for '%s'", revision, ref) + message := fmt.Sprintf("new revision '%s' for '%s'", revision, obj.Spec.URL) if obj.GetArtifact() != nil { conditions.MarkTrue(obj, sourcev1.ArtifactOutdatedCondition, "NewRevision", message) } diff --git a/internal/controller/ocirepository_controller_test.go b/internal/controller/ocirepository_controller_test.go index 86f034432..91c3fa748 100644 --- a/internal/controller/ocirepository_controller_test.go +++ b/internal/controller/ocirepository_controller_test.go @@ -1575,12 +1575,13 @@ func TestOCIRepository_reconcileSource_verifyOCISourceSignature_keyless(t *testi Reference: tt.reference, }, } - url := strings.TrimPrefix(obj.Spec.URL, "oci://") + ":" + tt.reference.Tag + + url := strings.TrimPrefix(obj.Spec.URL, "oci://") assertConditions := tt.assertConditions for k := range assertConditions { assertConditions[k].Message = strings.ReplaceAll(assertConditions[k].Message, "", tt.revision) - assertConditions[k].Message = strings.ReplaceAll(assertConditions[k].Message, "", url) + assertConditions[k].Message = strings.ReplaceAll(assertConditions[k].Message, "", obj.Spec.URL) assertConditions[k].Message = strings.ReplaceAll(assertConditions[k].Message, "", "cosign") }