From 11915d1ebde3a7782440cb85e1c47c84a80a5e8d Mon Sep 17 00:00:00 2001 From: Rohan Gupta Date: Fri, 6 Sep 2024 16:11:24 +0530 Subject: [PATCH] controllers: update storageclient connection fail log updated storageclient connetion fail log to show provider endpoint as well Signed-off-by: Rohan Gupta --- internal/controller/storageclaim_controller.go | 2 +- internal/controller/storageclient_controller.go | 2 +- service/status-report/main.go | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/internal/controller/storageclaim_controller.go b/internal/controller/storageclaim_controller.go index 497383d6..2eaf7f93 100644 --- a/internal/controller/storageclaim_controller.go +++ b/internal/controller/storageclaim_controller.go @@ -222,7 +222,7 @@ func (r *StorageClaimReconciler) reconcilePhases() (reconcile.Result, error) { 10*time.Second, ) if err != nil { - return reconcile.Result{}, fmt.Errorf("failed to create provider client: %v", err) + return reconcile.Result{}, fmt.Errorf("failed to create provider client with endpoint %v: %v", r.storageClient.Spec.StorageProviderEndpoint, err) } // Close client-side connections. diff --git a/internal/controller/storageclient_controller.go b/internal/controller/storageclient_controller.go index 6400c535..32ae5985 100644 --- a/internal/controller/storageclient_controller.go +++ b/internal/controller/storageclient_controller.go @@ -367,7 +367,7 @@ func (r *StorageClientReconciler) newExternalClusterClient() (*providerClient.OC ocsProviderClient, err := providerClient.NewProviderClient( r.ctx, r.storageClient.Spec.StorageProviderEndpoint, time.Second*10) if err != nil { - return nil, fmt.Errorf("failed to create a new provider client: %v", err) + return nil, fmt.Errorf("failed to create a new provider client with endpoint %v: %v", r.storageClient.Spec.StorageProviderEndpoint, err) } return ocsProviderClient, nil diff --git a/service/status-report/main.go b/service/status-report/main.go index c26675da..6dbebeb7 100644 --- a/service/status-report/main.go +++ b/service/status-report/main.go @@ -103,7 +103,7 @@ func main() { 10*time.Second, ) if err != nil { - klog.Exitf("Failed to create grpc client: %v", err) + klog.Exitf("Failed to create grpc client with endpoint %v: %v", storageClient.Spec.StorageProviderEndpoint, err) } defer providerClient.Close()