Skip to content

Commit

Permalink
[operator] fix kube clientcmd util
Browse files Browse the repository at this point in the history
  • Loading branch information
mfordjody committed Dec 8, 2024
1 parent 690a0fa commit f6643bc
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 17 deletions.
8 changes: 8 additions & 0 deletions dubboctl/pkg/cli/context.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ package cli
import (
"github.com/apache/dubbo-kubernetes/pkg/kube"
"github.com/apache/dubbo-kubernetes/pkg/pointer"
"k8s.io/client-go/rest"
)

type instance struct {
Expand Down Expand Up @@ -41,5 +42,12 @@ func (i *instance) CLIClientWithRevision(rev string) (kube.CLIClient, error) {
}

Check failure on line 42 in dubboctl/pkg/cli/context.go

View workflow job for this annotation

GitHub Actions / Go Test

missing return

func newKubeClientWithRevision(kubeconfig, context, revision string) (kube.CLIClient, error) {
drc, err := kube.DefaultRestConfig(kubeconfig, context, func(config *rest.Config) {

Check failure on line 45 in dubboctl/pkg/cli/context.go

View workflow job for this annotation

GitHub Actions / Go Test

drc declared and not used
config.QPS = 50
config.Burst = 100
})
if err != nil {
return nil, err
}
return nil, nil
}
3 changes: 2 additions & 1 deletion pkg/kube/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,8 @@ type CLIClient interface {

type ClientOption func(cliClient CLIClient) CLIClient

func NewClientClient(clientCfg clientcmd.ClientConfig) (CLIClient, error) {
func NewCLIClient(clientCfg clientcmd.ClientConfig, opts ...ClientOption) (CLIClient, error) {

return nil, nil
}

Expand Down
1 change: 0 additions & 1 deletion pkg/util/kube/util.go → pkg/kube/util.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ import (
"k8s.io/apimachinery/pkg/runtime/serializer"
"k8s.io/client-go/rest"
"k8s.io/client-go/tools/clientcmd"

"os"
)

Expand Down
15 changes: 0 additions & 15 deletions pkg/util/kube/client.go

This file was deleted.

0 comments on commit f6643bc

Please sign in to comment.