Skip to content

Commit eb40efe

Browse files
somtochiamastefanprodan
authored andcommitted
reconcile artifact
Signed-off-by: Somtochi Onyekwere <[email protected]>
1 parent 648beef commit eb40efe

File tree

1 file changed

+22
-0
lines changed

1 file changed

+22
-0
lines changed

controllers/ocirepository_controller_test.go

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -608,6 +608,28 @@ func TestOCIRepository_reconcileSource_remoteReference(t *testing.T) {
608608
*conditions.TrueCondition(sourcev1.FetchFailedCondition, sourcev1.OCIOperationFailedReason, "failed to pull artifact"),
609609
},
610610
},
611+
{
612+
name: "invalid semver reference",
613+
reference: &sourcev1.OCIRepositoryRef{
614+
SemVer: "<= 6.1.0",
615+
},
616+
want: sreconcile.ResultEmpty,
617+
wantErr: true,
618+
assertConditions: []metav1.Condition{
619+
*conditions.TrueCondition(sourcev1.FetchFailedCondition, sourcev1.URLInvalidReason, "no match found for semver:"),
620+
},
621+
},
622+
{
623+
name: "invalid digest reference",
624+
reference: &sourcev1.OCIRepositoryRef{
625+
Digest: "invalid",
626+
},
627+
want: sreconcile.ResultEmpty,
628+
wantErr: true,
629+
assertConditions: []metav1.Condition{
630+
*conditions.TrueCondition(sourcev1.FetchFailedCondition, sourcev1.OCIOperationFailedReason, "failed to pull artifact"),
631+
},
632+
},
611633
{
612634
name: "semver should take precedence over tag",
613635
reference: &sourcev1.OCIRepositoryRef{

0 commit comments

Comments
 (0)