@@ -28,7 +28,7 @@ import (
2828 "k8s.io/apimachinery/pkg/runtime"
2929 "k8s.io/apimachinery/pkg/types"
3030 cosiapi "sigs.k8s.io/container-object-storage-interface/client/apis/objectstorage/v1alpha2"
31- "sigs.k8s.io/container-object-storage-interface/internal/handoff "
31+ "sigs.k8s.io/container-object-storage-interface/internal/bucketaccess "
3232 ctrl "sigs.k8s.io/controller-runtime"
3333 "sigs.k8s.io/controller-runtime/pkg/client"
3434 "sigs.k8s.io/controller-runtime/pkg/client/fake"
@@ -194,10 +194,10 @@ func TestBucketAccessReconcile(t *testing.T) {
194194 status .Parameters ,
195195 )
196196
197- assert .True (t , handoff . BucketAccessManagedBySidecar (access )) // MUST hand off to sidecar
198- needInit , err := needsControllerInitialization (& access .Status ) // MUST be fully initialized
197+ assert .True (t , bucketaccess . ManagedBySidecar (access )) // MUST hand off to sidecar
198+ initialized , err := bucketaccess . SidecarRequirementsPresent (& access .Status ) // MUST be fully initialized
199199 assert .NoError (t , err )
200- assert .False (t , needInit )
200+ assert .True (t , initialized )
201201
202202 crw := & cosiapi.BucketClaim {}
203203 err = c .Get (ctx , readWriteClaimNsName , crw )
@@ -266,10 +266,10 @@ func TestBucketAccessReconcile(t *testing.T) {
266266 assert .Empty (t , status .AuthenticationType )
267267 assert .Empty (t , status .Parameters )
268268
269- assert .False (t , handoff . BucketAccessManagedBySidecar (access )) // MUST NOT hand off to sidecar
270- needInit , err := needsControllerInitialization (& access .Status ) // MUST NOT be initialized
269+ assert .False (t , bucketaccess . ManagedBySidecar (access )) // MUST NOT hand off to sidecar
270+ initialized , err := bucketaccess . SidecarRequirementsPresent (& access .Status ) // MUST NOT be initialized
271271 assert .NoError (t , err )
272- assert .True (t , needInit )
272+ assert .False (t , initialized )
273273
274274 crw := & cosiapi.BucketClaim {}
275275 err = c .Get (ctx , readWriteClaimNsName , crw )
@@ -314,10 +314,10 @@ func TestBucketAccessReconcile(t *testing.T) {
314314 assert .Empty (t , status .AuthenticationType )
315315 assert .Empty (t , status .Parameters )
316316
317- assert .False (t , handoff . BucketAccessManagedBySidecar (access )) // MUST NOT hand off to sidecar
318- needInit , err := needsControllerInitialization (& access .Status ) // MUST NOT be initialized
317+ assert .False (t , bucketaccess . ManagedBySidecar (access )) // MUST NOT hand off to sidecar
318+ initialized , err := bucketaccess . SidecarRequirementsPresent (& access .Status ) // MUST NOT be initialized
319319 assert .NoError (t , err )
320- assert .True (t , needInit )
320+ assert .False (t , initialized )
321321
322322 crw := & cosiapi.BucketClaim {}
323323 err = c .Get (ctx , readWriteClaimNsName , crw )
@@ -370,10 +370,10 @@ func TestBucketAccessReconcile(t *testing.T) {
370370 assert .Empty (t , status .AuthenticationType )
371371 assert .Empty (t , status .Parameters )
372372
373- assert .False (t , handoff . BucketAccessManagedBySidecar (access )) // MUST NOT hand off to sidecar
374- needInit , err := needsControllerInitialization (& access .Status ) // MUST NOT be initialized
373+ assert .False (t , bucketaccess . ManagedBySidecar (access )) // MUST NOT hand off to sidecar
374+ initialized , err := bucketaccess . SidecarRequirementsPresent (& access .Status ) // MUST NOT be initialized
375375 assert .NoError (t , err )
376- assert .True (t , needInit )
376+ assert .False (t , initialized )
377377
378378 crw := & cosiapi.BucketClaim {}
379379 err = c .Get (ctx , readWriteClaimNsName , crw )
@@ -423,10 +423,10 @@ func TestBucketAccessReconcile(t *testing.T) {
423423 assert .Empty (t , status .AuthenticationType )
424424 assert .Empty (t , status .Parameters )
425425
426- assert .False (t , handoff . BucketAccessManagedBySidecar (access )) // MUST NOT hand off to sidecar
427- needInit , err := needsControllerInitialization (& access .Status ) // MUST NOT be initialized
426+ assert .False (t , bucketaccess . ManagedBySidecar (access )) // MUST NOT hand off to sidecar
427+ initialized , err := bucketaccess . SidecarRequirementsPresent (& access .Status ) // MUST NOT be initialized
428428 assert .NoError (t , err )
429- assert .True (t , needInit )
429+ assert .False (t , initialized )
430430
431431 crw := & cosiapi.BucketClaim {}
432432 err = c .Get (ctx , readWriteClaimNsName , crw )
@@ -473,10 +473,10 @@ func TestBucketAccessReconcile(t *testing.T) {
473473 assert .Empty (t , status .AuthenticationType )
474474 assert .Empty (t , status .Parameters )
475475
476- assert .False (t , handoff . BucketAccessManagedBySidecar (access )) // MUST NOT hand off to sidecar
477- needInit , err := needsControllerInitialization (& access .Status ) // MUST NOT be initialized
476+ assert .False (t , bucketaccess . ManagedBySidecar (access )) // MUST NOT hand off to sidecar
477+ initialized , err := bucketaccess . SidecarRequirementsPresent (& access .Status ) // MUST NOT be initialized
478478 assert .NoError (t , err )
479- assert .True (t , needInit )
479+ assert .False (t , initialized )
480480
481481 crw := & cosiapi.BucketClaim {}
482482 err = c .Get (ctx , readWriteClaimNsName , crw )
@@ -525,10 +525,10 @@ func TestBucketAccessReconcile(t *testing.T) {
525525 assert .Empty (t , status .AuthenticationType )
526526 assert .Empty (t , status .Parameters )
527527
528- assert .False (t , handoff . BucketAccessManagedBySidecar (access )) // MUST NOT hand off to sidecar
529- needInit , err := needsControllerInitialization (& access .Status ) // MUST NOT be initialized
528+ assert .False (t , bucketaccess . ManagedBySidecar (access )) // MUST NOT hand off to sidecar
529+ initialized , err := bucketaccess . SidecarRequirementsPresent (& access .Status ) // MUST NOT be initialized
530530 assert .NoError (t , err )
531- assert .True (t , needInit )
531+ assert .False (t , initialized )
532532
533533 crw := & cosiapi.BucketClaim {}
534534 err = c .Get (ctx , readWriteClaimNsName , crw )
@@ -593,10 +593,10 @@ func TestBucketAccessReconcile(t *testing.T) {
593593 status .Parameters ,
594594 )
595595
596- assert .True (t , handoff . BucketAccessManagedBySidecar (access )) // MUST hand off to sidecar
597- needInit , err := needsControllerInitialization (& access .Status ) // MUST be fully initialized
596+ assert .True (t , bucketaccess . ManagedBySidecar (access )) // MUST hand off to sidecar
597+ initialized , err := bucketaccess . SidecarRequirementsPresent (& access .Status ) // MUST be fully initialized
598598 assert .NoError (t , err )
599- assert .False (t , needInit )
599+ assert .True (t , initialized )
600600
601601 crw := & cosiapi.BucketClaim {}
602602 err = c .Get (ctx , readWriteClaimNsName , crw )
@@ -649,10 +649,10 @@ func TestBucketAccessReconcile(t *testing.T) {
649649 assert .Empty (t , status .AuthenticationType )
650650 assert .Empty (t , status .Parameters )
651651
652- assert .False (t , handoff . BucketAccessManagedBySidecar (access )) // MUST NOT hand off to sidecar
653- needInit , err := needsControllerInitialization (& access .Status ) // MUST NOT be initialized
652+ assert .False (t , bucketaccess . ManagedBySidecar (access )) // MUST NOT hand off to sidecar
653+ initialized , err := bucketaccess . SidecarRequirementsPresent (& access .Status ) // MUST NOT be initialized
654654 assert .NoError (t , err )
655- assert .True (t , needInit )
655+ assert .False (t , initialized )
656656
657657 crw := & cosiapi.BucketClaim {}
658658 err = c .Get (ctx , readWriteClaimNsName , crw )
@@ -705,10 +705,10 @@ func TestBucketAccessReconcile(t *testing.T) {
705705 assert .Empty (t , status .AuthenticationType )
706706 assert .Empty (t , status .Parameters )
707707
708- assert .False (t , handoff . BucketAccessManagedBySidecar (access )) // MUST NOT hand off to sidecar
709- needInit , err := needsControllerInitialization (& access .Status ) // MUST NOT be initialized
708+ assert .False (t , bucketaccess . ManagedBySidecar (access )) // MUST NOT hand off to sidecar
709+ initialized , err := bucketaccess . SidecarRequirementsPresent (& access .Status ) // MUST NOT be initialized
710710 assert .NoError (t , err )
711- assert .True (t , needInit )
711+ assert .False (t , initialized )
712712
713713 crw := & cosiapi.BucketClaim {}
714714 err = c .Get (ctx , readWriteClaimNsName , crw )
0 commit comments