@@ -239,6 +239,7 @@ func TestOCIRepository_SecretRef(t *testing.T) {
239
239
g .Expect (err ).ToNot (HaveOccurred ())
240
240
241
241
repositoryURL := fmt .Sprintf ("%s/podinfo" , regServer .registryHost )
242
+ ociURL := fmt .Sprintf ("oci://%s" , repositoryURL )
242
243
243
244
// Push Test Image
244
245
err = crane .Push (image , repositoryURL , crane .WithAuth (& authn.Basic {
@@ -260,14 +261,14 @@ func TestOCIRepository_SecretRef(t *testing.T) {
260
261
}{
261
262
{
262
263
name : "private-registry-access-via-secretref" ,
263
- url : repositoryURL ,
264
+ url : ociURL ,
264
265
digest : podinfoImageDigest ,
265
266
includeSecretRef : true ,
266
267
includeServiceAccount : false ,
267
268
},
268
269
{
269
270
name : "private-registry-access-via-serviceaccount" ,
270
- url : repositoryURL ,
271
+ url : ociURL ,
271
272
digest : podinfoImageDigest ,
272
273
includeSecretRef : false ,
273
274
includeServiceAccount : true ,
@@ -289,7 +290,7 @@ func TestOCIRepository_SecretRef(t *testing.T) {
289
290
},
290
291
Type : corev1 .SecretTypeDockerConfigJson ,
291
292
StringData : map [string ]string {
292
- ".dockerconfigjson" : fmt .Sprintf (`{"auths": {%q: {"username": %q, "password": %q}}}` , tt . url , testRegistryUsername , testRegistryPassword ),
293
+ ".dockerconfigjson" : fmt .Sprintf (`{"auths": {%q: {"username": %q, "password": %q}}}` , repositoryURL , testRegistryUsername , testRegistryPassword ),
293
294
},
294
295
}
295
296
g .Expect (testEnv .CreateAndWait (ctx , secret )).To (Succeed ())
@@ -435,6 +436,7 @@ func TestOCIRepository_FailedAuth(t *testing.T) {
435
436
g .Expect (err ).ToNot (HaveOccurred ())
436
437
437
438
repositoryURL := fmt .Sprintf ("%s/podinfo" , regServer .registryHost )
439
+ ociURL := fmt .Sprintf ("oci://%s" , repositoryURL )
438
440
439
441
// Push Test Image
440
442
err = crane .Push (image , repositoryURL , crane .WithAuth (& authn.Basic {
@@ -458,7 +460,7 @@ func TestOCIRepository_FailedAuth(t *testing.T) {
458
460
}{
459
461
{
460
462
name : "missing-auth" ,
461
- url : repositoryURL ,
463
+ url : ociURL ,
462
464
repoUsername : "" ,
463
465
repoPassword : "" ,
464
466
digest : podinfoImageDigest ,
@@ -467,7 +469,7 @@ func TestOCIRepository_FailedAuth(t *testing.T) {
467
469
},
468
470
{
469
471
name : "invalid-auth-via-secret" ,
470
- url : repositoryURL ,
472
+ url : ociURL ,
471
473
repoUsername : "InvalidUser" ,
472
474
repoPassword : "InvalidPassword" ,
473
475
digest : podinfoImageDigest ,
@@ -476,7 +478,7 @@ func TestOCIRepository_FailedAuth(t *testing.T) {
476
478
},
477
479
{
478
480
name : "invalid-auth-via-service-account" ,
479
- url : repositoryURL ,
481
+ url : ociURL ,
480
482
repoUsername : "InvalidUser" ,
481
483
repoPassword : "InvalidPassword" ,
482
484
digest : podinfoImageDigest ,
@@ -500,7 +502,7 @@ func TestOCIRepository_FailedAuth(t *testing.T) {
500
502
},
501
503
Type : corev1 .SecretTypeDockerConfigJson ,
502
504
StringData : map [string ]string {
503
- ".dockerconfigjson" : fmt .Sprintf (`{"auths": {%q: {"username": %q, "password": %q}}}` , tt . url , tt .repoUsername , tt .repoPassword ),
505
+ ".dockerconfigjson" : fmt .Sprintf (`{"auths": {%q: {"username": %q, "password": %q}}}` , repositoryURL , tt .repoUsername , tt .repoPassword ),
504
506
},
505
507
}
506
508
g .Expect (testEnv .CreateAndWait (ctx , secret )).To (Succeed ())
@@ -623,7 +625,7 @@ func createPodinfoImageFromTar(tarFileName, tag string, imageServer *httptest.Se
623
625
}
624
626
625
627
return & podinfoImage {
626
- url : repositoryURL ,
628
+ url : "oci://" + repositoryURL ,
627
629
tag : tag ,
628
630
digest : podinfoImageDigest ,
629
631
}, nil
0 commit comments