@@ -69,7 +69,7 @@ func (n *NodeClient) getBAR(ctx context.Context, barName, barNs string) (*v1alph
6969if len (bar .Spec .BucketRequestName ) == 0 {
7070return nil , fmt .Errorf ("bucketAccessRequest.Spec.BucketRequestName unset" )
7171}
72- if len (bar .Spec .BucketAccessName ) == 0 {
72+ if len (bar .Status .BucketAccessName ) == 0 {
7373return nil , fmt .Errorf ("bucketAccessRequest.Spec.BucketAccessName unset" )
7474}
7575return bar , nil
@@ -105,7 +105,7 @@ func (n *NodeClient) getBR(ctx context.Context, brName, brNs string) (*v1alpha1.
105105if ! br .Status .BucketAvailable {
106106return nil , logErr (fmt .Errorf ("bucketRequest is not available yet %q" , fmt .Sprintf ("%s/%s" , brNs , brName )))
107107}
108- if len (br .Spec . BucketInstanceName ) == 0 {
108+ if len (br .Status . BucketName ) == 0 {
109109return nil , logErr (fmt .Errorf ("bucketRequest.Spec.BucketInstanceName unset" ))
110110}
111111return br , nil
@@ -138,15 +138,15 @@ func (n *NodeClient) GetResources(ctx context.Context, barName, barNs string) (b
138138return
139139}
140140
141- if ba , err = n .getBA (ctx , bar .Spec .BucketAccessName ); err != nil {
141+ if ba , err = n .getBA (ctx , bar .Status .BucketAccessName ); err != nil {
142142return
143143}
144144
145145if br , err = n .getBR (ctx , bar .Spec .BucketRequestName , barNs ); err != nil {
146146return
147147}
148148
149- if bkt , err = n .getB (ctx , br .Spec . BucketInstanceName ); err != nil {
149+ if bkt , err = n .getB (ctx , br .Status . BucketName ); err != nil {
150150return
151151}
152152
@@ -160,15 +160,15 @@ func (n *NodeClient) GetResources(ctx context.Context, barName, barNs string) (b
160160func (n * NodeClient ) getProtocol (bkt * v1alpha1.Bucket ) (data []byte , err error ) {
161161klog .Infof ("bucket protocol %+v" , bkt .Spec .Protocol )
162162var protocolConnection interface {}
163- switch bkt . Spec . Protocol . Name {
164- case v1alpha1 . ProtocolNameS3 :
163+ switch {
164+ case bkt . Spec . Protocol . S3 != nil :
165165protocolConnection = bkt .Spec .Protocol .S3
166- case v1alpha1 . ProtocolNameAzure :
166+ case bkt . Spec . Protocol . AzureBlob != nil :
167167protocolConnection = bkt .Spec .Protocol .AzureBlob
168- case v1alpha1 . ProtocolNameGCS :
168+ case bkt . Spec . Protocol . GCS != nil :
169169protocolConnection = bkt .Spec .Protocol .GCS
170170default :
171- err = fmt .Errorf ("unrecognized protocol %q , unable to extract connection data" , bkt .Spec .Protocol . Name )
171+ err = fmt .Errorf ("unrecognized protocol %+v , unable to extract connection data" , bkt .Spec .Protocol )
172172}
173173if err != nil {
174174return nil , logErr (err )
0 commit comments