@@ -188,7 +188,7 @@ func setRetryConfig(ctx context.Context, sc *storage.Client, clientConfig *stora
188188}
189189
190190// Followed https://pkg.go.dev/cloud.google.com/go/storage#hdr-Experimental_gRPC_API to create the gRPC client.
191- func createGRPCClientHandle (ctx context.Context , clientConfig * storageutil.StorageClientConfig , isbucketRapid bool , enableBidiConfig bool , bucketName string , billingProject string ) (* storage.Client , error ) {
191+ func createGRPCClientHandle (ctx context.Context , clientConfig * storageutil.StorageClientConfig , isBucketRapid bool , enableBidiConfig bool , bucketName string , billingProject string ) (* storage.Client , error ) {
192192 if err := os .Setenv ("GOOGLE_CLOUD_ENABLE_DIRECT_PATH_XDS" , "true" ); err != nil {
193193 return nil , fmt .Errorf ("error setting direct path env var: %w" , err )
194194 }
@@ -202,7 +202,7 @@ func createGRPCClientHandle(ctx context.Context, clientConfig *storageutil.Stora
202202
203203 // Add DirectPath enforcement - client creation will fail if DirectPath is not available.
204204 // Rapid buckets do not support DirectPath enforcement headers.
205- if ! isbucketRapid {
205+ if ! isBucketRapid {
206206 clientOpts = append (clientOpts , experimental .WithDirectConnectivityEnforced ())
207207 }
208208
@@ -217,14 +217,15 @@ func createGRPCClientHandle(ctx context.Context, clientConfig *storageutil.Stora
217217 setRetryConfig (ctx , sc , clientConfig )
218218 }()
219219
220- // Direct-path verification is fatal for regional. Todo(b/503624405): Make it fatal for all after making the dummy-stat reliable.
221- if verifyErr := verifyDirectPathConnectivity (ctx , clientConfig , bucketName , sc , billingProject ); verifyErr != nil {
222- logger .Warnf ("DirectPath verification failed with error: %v" , verifyErr )
223- if ! isbucketRapid {
220+ // Skip DirectPath verification for Rapid buckets as DirectPath is not supported/enforced.
221+ if ! isBucketRapid {
222+ // DirectPath verification is fatal for regional. Todo(b/503624405): Make it fatal for all after making the dummy-stat reliable.
223+ if verifyErr := verifyDirectPathConnectivity (ctx , clientConfig , bucketName , sc , billingProject ); verifyErr != nil {
224+ logger .Warnf ("DirectPath verification failed with error: %v" , verifyErr )
224225 return nil , verifyErr
226+ } else {
227+ logger .Infof ("DirectPath verification succeeded, continuing with DirectPath." )
225228 }
226- } else {
227- logger .Infof ("DirectPath verification succeeded, continuing with DirectPath." )
228229 }
229230
230231 return sc , nil
0 commit comments