diff --git a/pkg/kosmosctl/join/join.go b/pkg/kosmosctl/join/join.go index bd3681cae..3cbc91167 100644 --- a/pkg/kosmosctl/join/join.go +++ b/pkg/kosmosctl/join/join.go @@ -114,7 +114,7 @@ func NewCmdJoin(f ctlutil.Factory) *cobra.Command { func (o *CommandJoinOptions) Complete(f ctlutil.Factory) error { hostConfig, err := utils.RestConfig(o.HostKubeConfig, o.HostContext) if err != nil { - return fmt.Errorf("kosmosctl install complete error, generate host rest config failed: %s", err) + return fmt.Errorf("kosmosctl join complete error, generate host rest config failed: %s", err) } if o.Version == "" { @@ -123,23 +123,23 @@ func (o *CommandJoinOptions) Complete(f ctlutil.Factory) error { o.KosmosClient, err = versioned.NewForConfig(hostConfig) if err != nil { - return fmt.Errorf("kosmosctl install complete error, generate Kosmos client failed: %v", err) + return fmt.Errorf("kosmosctl join complete error, generate Kosmos client failed: %v", err) } if len(o.KubeConfig) > 0 { clusterConfig, err := utils.RestConfig(o.KubeConfig, o.Context) if err != nil { - return fmt.Errorf("kosmosctl install complete error, generate rest config failed: %s", err) + return fmt.Errorf("kosmosctl join complete error, generate rest config failed: %s", err) } rawConfig, err := utils.RawConfig(o.KubeConfig, o.Context) if err != nil { - return fmt.Errorf("kosmosctl install complete error, generate raw config failed: %s", err) + return fmt.Errorf("kosmosctl join complete error, generate raw config failed: %s", err) } streams, err := clientcmd.Write(rawConfig) if err != nil { - return fmt.Errorf("kosmosctl install complete error, generate config streams failed: %s", err) + return fmt.Errorf("kosmosctl join complete error, wite restconfig to streams failed: %s", err) } o.KubeConfigStream = streams diff --git a/pkg/kosmosctl/uninstall/uninstall.go b/pkg/kosmosctl/uninstall/uninstall.go index 39d9c6041..a64c9089d 100644 --- a/pkg/kosmosctl/uninstall/uninstall.go +++ b/pkg/kosmosctl/uninstall/uninstall.go @@ -84,7 +84,7 @@ func NewCmdUninstall() *cobra.Command { func (o *CommandUninstallOptions) Complete() error { config, err := utils.RestConfig(o.KubeConfig, o.Context) if err != nil { - return fmt.Errorf("kosmosctl install complete error, generate config failed: %s", err) + return fmt.Errorf("kosmosctl uninstall complete error, generate config failed: %s", err) } if o.Version == "" { @@ -93,7 +93,7 @@ func (o *CommandUninstallOptions) Complete() error { o.KosmosClient, err = versioned.NewForConfig(config) if err != nil { - return fmt.Errorf("kosmosctl install complete error, generate Kosmos client failed: %v", err) + return fmt.Errorf("kosmosctl uninstall complete error, generate Kosmos client failed: %v", err) } o.K8sClient, err = kubernetes.NewForConfig(config) @@ -510,7 +510,7 @@ func (o *CommandUninstallOptions) runCoredns() error { } err = o.K8sClient.RbacV1().ClusterRoles().Delete(context.TODO(), cRole.Name, metav1.DeleteOptions{}) if err != nil && !apierrors.IsNotFound(err) { - return fmt.Errorf("kosmosctl install coredns run error, clusterrole options failed: %v", err) + return fmt.Errorf("kosmosctl uninstall coredns run error, clusterrole options failed: %v", err) } klog.Info("ClusterRole " + cRole.Name + " is deleted.") diff --git a/pkg/kosmosctl/unjoin/unjoin.go b/pkg/kosmosctl/unjoin/unjoin.go index 2d5dc0a16..19a7943c9 100644 --- a/pkg/kosmosctl/unjoin/unjoin.go +++ b/pkg/kosmosctl/unjoin/unjoin.go @@ -75,20 +75,20 @@ func NewCmdUnJoin(f ctlutil.Factory) *cobra.Command { func (o *CommandUnJoinOptions) Complete(f ctlutil.Factory) error { hostConfig, err := utils.RestConfig(o.HostKubeConfig, o.HostContext) if err != nil { - return fmt.Errorf("kosmosctl install complete error, generate host config failed: %s", err) + return fmt.Errorf("kosmosctl unjoin complete error, generate host config failed: %s", err) } var clusterConfig *restclient.Config o.KosmosClient, err = versioned.NewForConfig(hostConfig) if err != nil { - return fmt.Errorf("kosmosctl install complete error, generate Kosmos client failed: %v", err) + return fmt.Errorf("kosmosctl unjoin complete error, generate Kosmos client failed: %v", err) } if o.KubeConfig != "" { clusterConfig, err = utils.RestConfig(o.KubeConfig, o.Context) if err != nil { - return fmt.Errorf("kosmosctl install complete error, generate config failed: %s", err) + return fmt.Errorf("kosmosctl unjoin complete error, generate config failed: %s", err) } } else { var cluster *v1alpha1.Cluster