@@ -29,7 +29,7 @@ import (
2929 "k8s.io/apimachinery/pkg/types"
3030 "k8s.io/utils/ptr"
3131 cosiapi "sigs.k8s.io/container-object-storage-interface/client/apis/objectstorage/v1alpha2"
32- "sigs.k8s.io/container-object-storage-interface/internal/handoff "
32+ "sigs.k8s.io/container-object-storage-interface/internal/bucketaccess "
3333 ctrl "sigs.k8s.io/controller-runtime"
3434 "sigs.k8s.io/controller-runtime/pkg/client"
3535 "sigs.k8s.io/controller-runtime/pkg/client/fake"
@@ -195,10 +195,10 @@ func TestBucketAccessReconcile(t *testing.T) {
195195 status .Parameters ,
196196 )
197197
198- assert .True (t , handoff . BucketAccessManagedBySidecar (access )) // MUST hand off to sidecar
199- needInit , err := needsControllerInitialization (& access .Status ) // MUST be fully initialized
198+ assert .True (t , bucketaccess . ManagedBySidecar (access )) // MUST hand off to sidecar
199+ initialized , err := bucketaccess . SidecarRequirementsPresent (& access .Status ) // MUST be fully initialized
200200 assert .NoError (t , err )
201- assert .False (t , needInit )
201+ assert .True (t , initialized )
202202
203203 crw := & cosiapi.BucketClaim {}
204204 err = c .Get (ctx , readWriteClaimNsName , crw )
@@ -267,10 +267,10 @@ func TestBucketAccessReconcile(t *testing.T) {
267267 assert .Empty (t , status .AuthenticationType )
268268 assert .Empty (t , status .Parameters )
269269
270- assert .False (t , handoff . BucketAccessManagedBySidecar (access )) // MUST NOT hand off to sidecar
271- needInit , err := needsControllerInitialization (& access .Status ) // MUST NOT be initialized
270+ assert .False (t , bucketaccess . ManagedBySidecar (access )) // MUST NOT hand off to sidecar
271+ initialized , err := bucketaccess . SidecarRequirementsPresent (& access .Status ) // MUST NOT be initialized
272272 assert .NoError (t , err )
273- assert .True (t , needInit )
273+ assert .False (t , initialized )
274274
275275 crw := & cosiapi.BucketClaim {}
276276 err = c .Get (ctx , readWriteClaimNsName , crw )
@@ -315,10 +315,10 @@ func TestBucketAccessReconcile(t *testing.T) {
315315 assert .Empty (t , status .AuthenticationType )
316316 assert .Empty (t , status .Parameters )
317317
318- assert .False (t , handoff . BucketAccessManagedBySidecar (access )) // MUST NOT hand off to sidecar
319- needInit , err := needsControllerInitialization (& access .Status ) // MUST NOT be initialized
318+ assert .False (t , bucketaccess . ManagedBySidecar (access )) // MUST NOT hand off to sidecar
319+ initialized , err := bucketaccess . SidecarRequirementsPresent (& access .Status ) // MUST NOT be initialized
320320 assert .NoError (t , err )
321- assert .True (t , needInit )
321+ assert .False (t , initialized )
322322
323323 crw := & cosiapi.BucketClaim {}
324324 err = c .Get (ctx , readWriteClaimNsName , crw )
@@ -371,10 +371,10 @@ func TestBucketAccessReconcile(t *testing.T) {
371371 assert .Empty (t , status .AuthenticationType )
372372 assert .Empty (t , status .Parameters )
373373
374- assert .False (t , handoff . BucketAccessManagedBySidecar (access )) // MUST NOT hand off to sidecar
375- needInit , err := needsControllerInitialization (& access .Status ) // MUST NOT be initialized
374+ assert .False (t , bucketaccess . ManagedBySidecar (access )) // MUST NOT hand off to sidecar
375+ initialized , err := bucketaccess . SidecarRequirementsPresent (& access .Status ) // MUST NOT be initialized
376376 assert .NoError (t , err )
377- assert .True (t , needInit )
377+ assert .False (t , initialized )
378378
379379 crw := & cosiapi.BucketClaim {}
380380 err = c .Get (ctx , readWriteClaimNsName , crw )
@@ -424,10 +424,10 @@ func TestBucketAccessReconcile(t *testing.T) {
424424 assert .Empty (t , status .AuthenticationType )
425425 assert .Empty (t , status .Parameters )
426426
427- assert .False (t , handoff . BucketAccessManagedBySidecar (access )) // MUST NOT hand off to sidecar
428- needInit , err := needsControllerInitialization (& access .Status ) // MUST NOT be initialized
427+ assert .False (t , bucketaccess . ManagedBySidecar (access )) // MUST NOT hand off to sidecar
428+ initialized , err := bucketaccess . SidecarRequirementsPresent (& access .Status ) // MUST NOT be initialized
429429 assert .NoError (t , err )
430- assert .True (t , needInit )
430+ assert .False (t , initialized )
431431
432432 crw := & cosiapi.BucketClaim {}
433433 err = c .Get (ctx , readWriteClaimNsName , crw )
@@ -474,10 +474,10 @@ func TestBucketAccessReconcile(t *testing.T) {
474474 assert .Empty (t , status .AuthenticationType )
475475 assert .Empty (t , status .Parameters )
476476
477- assert .False (t , handoff . BucketAccessManagedBySidecar (access )) // MUST NOT hand off to sidecar
478- needInit , err := needsControllerInitialization (& access .Status ) // MUST NOT be initialized
477+ assert .False (t , bucketaccess . ManagedBySidecar (access )) // MUST NOT hand off to sidecar
478+ initialized , err := bucketaccess . SidecarRequirementsPresent (& access .Status ) // MUST NOT be initialized
479479 assert .NoError (t , err )
480- assert .True (t , needInit )
480+ assert .False (t , initialized )
481481
482482 crw := & cosiapi.BucketClaim {}
483483 err = c .Get (ctx , readWriteClaimNsName , crw )
@@ -526,10 +526,10 @@ func TestBucketAccessReconcile(t *testing.T) {
526526 assert .Empty (t , status .AuthenticationType )
527527 assert .Empty (t , status .Parameters )
528528
529- assert .False (t , handoff . BucketAccessManagedBySidecar (access )) // MUST NOT hand off to sidecar
530- needInit , err := needsControllerInitialization (& access .Status ) // MUST NOT be initialized
529+ assert .False (t , bucketaccess . ManagedBySidecar (access )) // MUST NOT hand off to sidecar
530+ initialized , err := bucketaccess . SidecarRequirementsPresent (& access .Status ) // MUST NOT be initialized
531531 assert .NoError (t , err )
532- assert .True (t , needInit )
532+ assert .False (t , initialized )
533533
534534 crw := & cosiapi.BucketClaim {}
535535 err = c .Get (ctx , readWriteClaimNsName , crw )
@@ -594,10 +594,10 @@ func TestBucketAccessReconcile(t *testing.T) {
594594 status .Parameters ,
595595 )
596596
597- assert .True (t , handoff . BucketAccessManagedBySidecar (access )) // MUST hand off to sidecar
598- needInit , err := needsControllerInitialization (& access .Status ) // MUST be fully initialized
597+ assert .True (t , bucketaccess . ManagedBySidecar (access )) // MUST hand off to sidecar
598+ initialized , err := bucketaccess . SidecarRequirementsPresent (& access .Status ) // MUST be fully initialized
599599 assert .NoError (t , err )
600- assert .False (t , needInit )
600+ assert .True (t , initialized )
601601
602602 crw := & cosiapi.BucketClaim {}
603603 err = c .Get (ctx , readWriteClaimNsName , crw )
@@ -650,10 +650,10 @@ func TestBucketAccessReconcile(t *testing.T) {
650650 assert .Empty (t , status .AuthenticationType )
651651 assert .Empty (t , status .Parameters )
652652
653- assert .False (t , handoff . BucketAccessManagedBySidecar (access )) // MUST NOT hand off to sidecar
654- needInit , err := needsControllerInitialization (& access .Status ) // MUST NOT be initialized
653+ assert .False (t , bucketaccess . ManagedBySidecar (access )) // MUST NOT hand off to sidecar
654+ initialized , err := bucketaccess . SidecarRequirementsPresent (& access .Status ) // MUST NOT be initialized
655655 assert .NoError (t , err )
656- assert .True (t , needInit )
656+ assert .False (t , initialized )
657657
658658 crw := & cosiapi.BucketClaim {}
659659 err = c .Get (ctx , readWriteClaimNsName , crw )
@@ -706,10 +706,10 @@ func TestBucketAccessReconcile(t *testing.T) {
706706 assert .Empty (t , status .AuthenticationType )
707707 assert .Empty (t , status .Parameters )
708708
709- assert .False (t , handoff . BucketAccessManagedBySidecar (access )) // MUST NOT hand off to sidecar
710- needInit , err := needsControllerInitialization (& access .Status ) // MUST NOT be initialized
709+ assert .False (t , bucketaccess . ManagedBySidecar (access )) // MUST NOT hand off to sidecar
710+ initialized , err := bucketaccess . SidecarRequirementsPresent (& access .Status ) // MUST NOT be initialized
711711 assert .NoError (t , err )
712- assert .True (t , needInit )
712+ assert .False (t , initialized )
713713
714714 crw := & cosiapi.BucketClaim {}
715715 err = c .Get (ctx , readWriteClaimNsName , crw )
0 commit comments