Skip to content

Commit 340c9f2

Browse files
authored
Fix: crd client support kubeconfig (#7)
Signed-off-by: huiwq1990 <huiwq1990@163.com>
1 parent 1072771 commit 340c9f2

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

pkg/k8s/k8s.go

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@ import (
1212
k8sruntime "k8s.io/apimachinery/pkg/runtime"
1313
"k8s.io/client-go/kubernetes"
1414
"k8s.io/client-go/tools/clientcmd"
15-
ctr "sigs.k8s.io/controller-runtime"
1615
"sigs.k8s.io/controller-runtime/pkg/client"
1716

1817
oamapi "github.com/oam-dev/kubevela-core-api/apis/core.oam.dev"
@@ -49,7 +48,7 @@ func New(kubeconfig string) *k8s {
4948
log.WithError(err).Fatal("error creating kubernetes client")
5049
}
5150

52-
cc, err := client.New(ctr.GetConfigOrDie(), client.Options{Scheme: Scheme})
51+
cc, err := client.New(config, client.Options{Scheme: Scheme})
5352
if err != nil {
5453
log.WithError(err).Fatal("error creating controller runtime client")
5554
}

0 commit comments

Comments
 (0)