reconcile artifact

Signed-off-by: Somtochi Onyekwere <somtochionyekwere@gmail.com>
This commit is contained in:
Somtochi Onyekwere 2022-07-22 22:28:11 +01:00 committed by Stefan Prodan
parent 648beef063
commit eb40efea1c
No known key found for this signature in database
GPG Key ID: 3299AEB0E4085BAF
1 changed files with 22 additions and 0 deletions

View File

@ -608,6 +608,28 @@ func TestOCIRepository_reconcileSource_remoteReference(t *testing.T) {
*conditions.TrueCondition(sourcev1.FetchFailedCondition, sourcev1.OCIOperationFailedReason, "failed to pull artifact"), *conditions.TrueCondition(sourcev1.FetchFailedCondition, sourcev1.OCIOperationFailedReason, "failed to pull artifact"),
}, },
}, },
{
name: "invalid semver reference",
reference: &sourcev1.OCIRepositoryRef{
SemVer: "<= 6.1.0",
},
want: sreconcile.ResultEmpty,
wantErr: true,
assertConditions: []metav1.Condition{
*conditions.TrueCondition(sourcev1.FetchFailedCondition, sourcev1.URLInvalidReason, "no match found for semver:"),
},
},
{
name: "invalid digest reference",
reference: &sourcev1.OCIRepositoryRef{
Digest: "invalid",
},
want: sreconcile.ResultEmpty,
wantErr: true,
assertConditions: []metav1.Condition{
*conditions.TrueCondition(sourcev1.FetchFailedCondition, sourcev1.OCIOperationFailedReason, "failed to pull artifact"),
},
},
{ {
name: "semver should take precedence over tag", name: "semver should take precedence over tag",
reference: &sourcev1.OCIRepositoryRef{ reference: &sourcev1.OCIRepositoryRef{