@@ -3,26 +3,20 @@ package k8s
33import (
44 "context"
55 "fmt"
6+
67 "github.com/seata/seata-ctl/action/k8s/utils"
78 "github.com/seata/seata-ctl/tool"
89 "github.com/spf13/cobra"
9- _ "gopkg.in/yaml.v3"
10- _ "io/ioutil"
1110 appsv1 "k8s.io/api/apps/v1"
1211 corev1 "k8s.io/api/core/v1"
13- _ "k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1"
1412 "k8s.io/apimachinery/pkg/api/errors"
15- _ "k8s.io/apimachinery/pkg/api/errors"
1613 metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
17- _ "k8s.io/apimachinery/pkg/apis/meta/v1/unstructured"
18- _ "k8s.io/apimachinery/pkg/runtime/schema"
19- _ "k8s.io/client-go/applyconfigurations/meta/v1"
2014)
2115
2216var InstallCmd = & cobra.Command {
2317 Use : "install" ,
2418 Short : "Install Kubernetes CRD controller" ,
25- Run : func (cmd * cobra.Command , args []string ) {
19+ Run : func (_ * cobra.Command , _ []string ) {
2620 err := DeployCRD ()
2721 if err != nil {
2822 tool .Logger .Errorf ("install CRD err: %v" , err )
@@ -65,7 +59,7 @@ func DeployController() error {
6559 _ , err = client .AppsV1 ().Deployments (namespace ).Get (context .TODO (), deploymentName , metav1.GetOptions {})
6660 if err == nil {
6761 // If the Deployment exists, output a message and return
68- return fmt .Errorf ("Deployment '%s' already exists in the '%s' namespace\n " , deploymentName , Namespace )
62+ return fmt .Errorf ("deployment '%s' already exists in the '%s' namespace" , deploymentName , Namespace )
6963 } else if ! errors .IsNotFound (err ) {
7064 // If there is an error other than "not found", return it
7165 return fmt .Errorf ("error checking for existing deployment: %v" , err )
0 commit comments