You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@dubbo.apache.org by zh...@apache.org on 2024/12/20 04:38:31 UTC

(dubbo-kubernetes) branch master updated: [operator] Add uninstall logic

This is an automated email from the ASF dual-hosted git repository.

zhongxjian pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/dubbo-kubernetes.git


The following commit(s) were added to refs/heads/master by this push:
     new ca44064b [operator] Add uninstall logic
ca44064b is described below

commit ca44064bfafc3ff76c0b01d4142d817491b99755
Author: mfordjody <11...@qq.com>
AuthorDate: Fri Dec 20 12:38:20 2024 +0800

    [operator] Add uninstall logic
---
 operator/cmd/cluster/install.go   | 15 ++++++++-------
 operator/cmd/cluster/uninstall.go | 23 +++++++++++++++--------
 2 files changed, 23 insertions(+), 15 deletions(-)

diff --git a/operator/cmd/cluster/install.go b/operator/cmd/cluster/install.go
index 521ee40c..84a1a059 100644
--- a/operator/cmd/cluster/install.go
+++ b/operator/cmd/cluster/install.go
@@ -49,14 +49,15 @@ func InstallCmdWithArgs(ctx cli.Context, rootArgs *RootArgs, iArgs *installArgs)
 		Use:   "install",
 		Short: "Applies an Dubbo manifest, installing or reconfiguring Dubbo on a cluster",
 		Long:  "The install command generates an Dubbo install manifest and applies it to a cluster",
-		Example: `# Apply a default dubboctl installation.
-dubboctl install
+		Example: `  # Apply a default dubboctl installation.
+  dubboctl install
+  
+  # Apply a config file.
+  dubboctl install -f my-config.yaml
+  
+  # Apply a default profile.
+  dubboctl install --profile=demo
 
-# Apply a default profile.
-dubboctl install --profile=default
-
-# Apply a config file.
-dubboctl install -f my-config.yaml
 		`,
 		Aliases: []string{"apply"},
 		Args:    cobra.ExactArgs(0),
diff --git a/operator/cmd/cluster/uninstall.go b/operator/cmd/cluster/uninstall.go
index a95960de..47cf9d86 100644
--- a/operator/cmd/cluster/uninstall.go
+++ b/operator/cmd/cluster/uninstall.go
@@ -6,30 +6,37 @@ import (
 )
 
 type uninstallArgs struct {
-	files        []string
+	files        string
 	sets         []string
 	manifestPath string
 	purge        bool
 }
 
-func addUninstallFlags() {
-
+func addUninstallFlags(cmd *cobra.Command, args *uninstallArgs) {
+	cmd.PersistentFlags().StringVarP(&args.files, "filename", "f", "",
+		"The filename of the IstioOperator CR.")
+	cmd.PersistentFlags().StringArrayVarP(&args.sets, "set", "s", nil, "Override dubboOperator values, such as selecting profiles, etc")
+	cmd.PersistentFlags().BoolVar(&args.purge, "purge", false, "Remove all dubbo-related source code")
 }
 
 func UninstallCmd(ctx cli.Context) *cobra.Command {
 	rootArgs := &RootArgs{}
 	uiArgs := &uninstallArgs{}
 	uicmd := &cobra.Command{
-		Use:     "uninstall",
-		Short:   "Uninstall Dubbo-related resources",
-		Long:    "",
-		Example: ``,
+		Use:   "uninstall",
+		Short: "Uninstall Dubbo-related resources",
+		Long:  "Uninstalling Dubbo from the Cluster",
+		Example: `ยท# Uninstall a single control plane by dop file
+  dubboctl uninstall -f dop.yaml
+  
+  # Uninstall all control planes and shared resources
+  dubboctl uninstall --purge`,
 		RunE: func(cmd *cobra.Command, args []string) error {
 			return uninstall(cmd, ctx, rootArgs, uiArgs)
 		},
 	}
 	addFlags(uicmd, rootArgs)
-	addUninstallFlags()
+	addUninstallFlags(uicmd, uiArgs)
 	return uicmd
 }