From 2ae5733cbcbdab4a6647b11c8149ca4bb19010f9 Mon Sep 17 00:00:00 2001
From: williamlee <909445583@qq.com>
Date: Wed, 30 Mar 2022 17:39:13 +0800
Subject: [PATCH] add 'configPath not exist' log

---
 internal/commands/root/root.go | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/internal/commands/root/root.go b/internal/commands/root/root.go
index 095ccfb..c986be2 100644
--- a/internal/commands/root/root.go
+++ b/internal/commands/root/root.go
@@ -73,7 +73,7 @@ func runRootCommand(ctx context.Context, s *provider.Store, c *opts.Opts) error
 		return errors.Errorf("provider %q not found", c.Provider)
 	}
 
-	client, err := newClient(c.KubeConfigPath, c.KubeAPIQPS, c.KubeAPIBurst)
+	client, err := newClient(ctx, c.KubeConfigPath, c.KubeAPIQPS, c.KubeAPIBurst)
 	if err != nil {
 		return err
 	}
@@ -279,7 +279,7 @@ func waitFor(ctx context.Context, time time.Duration, ready <-chan struct{}) err
 	}
 }
 
-func newClient(configPath string, qps, burst int32) (*kubernetes.Clientset, error) {
+func newClient(ctx context.Context, configPath string, qps, burst int32) (*kubernetes.Clientset, error) {
 	var config *rest.Config
 
 	// Check if the kubeConfig file exists.
@@ -291,6 +291,7 @@ func newClient(configPath string, qps, burst int32) (*kubernetes.Clientset, erro
 		}
 	} else {
 		// Set to in-cluster config.
+		log.G(ctx).Infof("configPath: %q is not exist, it will run as in-cluster.", configPath)
 		config, err = rest.InClusterConfig()
 		if err != nil {
 			return nil, errors.Wrap(err, "error building in cluster config")