From 31f126f0f8a15050e60b35589ca388d54e868350 Mon Sep 17 00:00:00 2001 From: LiZhenCheng9527 Date: Thu, 1 Feb 2024 21:07:29 +0800 Subject: [PATCH] fix Fixed kurator-member.config file path error Signed-off-by: LiZhenCheng9527 --- e2e/attachedcluster_test.go | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/e2e/attachedcluster_test.go b/e2e/attachedcluster_test.go index 35b51ab1..5f218ede 100644 --- a/e2e/attachedcluster_test.go +++ b/e2e/attachedcluster_test.go @@ -18,6 +18,7 @@ package e2e import ( "os" + "path/filepath" "time" "github.com/onsi/ginkgo/v2" @@ -42,7 +43,9 @@ var _ = ginkgo.Describe("[AttachedClusters] AttachedClusters testing", func() { namespace = "default" fleetname = "e2etest" memberClusterName = "kurator-member" - kubeconfigPath = "/root/.kube/kurator-member.config" + homeDir, err := os.UserHomeDir() + gomega.Expect(err).ShouldNot(gomega.HaveOccurred()) + kubeconfigPath = filepath.Join(homeDir, ".kube/kurator-member.config") // build secrets use member cluster kubeconfig kubeconfig, readfileErr := os.ReadFile(kubeconfigPath)