Skip to content

Commit 2c6f87b

Browse files
committed
potential fix for warnings printed
closes #100
1 parent 24329ca commit 2c6f87b

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

cmd/kubectl-tree/rootcmd.go

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ import (
2828
"github.com/spf13/pflag"
2929
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
3030
"k8s.io/cli-runtime/pkg/genericclioptions"
31+
"k8s.io/client-go/discovery"
3132
"k8s.io/client-go/dynamic"
3233
_ "k8s.io/client-go/plugin/pkg/client/auth" // combined authprovider import
3334
"k8s.io/client-go/rest"
@@ -108,9 +109,9 @@ func run(command *cobra.Command, args []string) error {
108109
if err != nil {
109110
return fmt.Errorf("failed to construct dynamic client: %w", err)
110111
}
111-
dc, err := cf.ToDiscoveryClient()
112+
dc, err := discovery.NewDiscoveryClientForConfig(restConfig)
112113
if err != nil {
113-
return err
114+
return fmt.Errorf("failed to construct discovery client: %w", err)
114115
}
115116

116117
apis, err := findAPIs(dc)

0 commit comments

Comments
 (0)