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 eaa8de4a [operator] Add install group logic
eaa8de4a is described below

commit eaa8de4add06aa6c02d853fc0cc04676dbd3700c
Author: mfordjody <[email protected]>
AuthorDate: Thu Dec 5 12:33:03 2024 +0800

    [operator] Add install group logic
---
 dubboctl/cmd/root.go              |  7 +++++++
 operator/cmd/cluster/install.go   | 10 +++++-----
 operator/cmd/cluster/uninstall.go | 17 +++++++++++++++++
 operator/cmd/cluster/upgrade.go   | 14 ++++++++++++++
 4 files changed, 43 insertions(+), 5 deletions(-)

diff --git a/dubboctl/cmd/root.go b/dubboctl/cmd/root.go
index 973de7d3..d8bd6f20 100644
--- a/dubboctl/cmd/root.go
+++ b/dubboctl/cmd/root.go
@@ -41,6 +41,13 @@ func GetRootCmd(args []string) *cobra.Command {
 
        installCmd := cluster.InstallCmd(ctx)
        rootCmd.AddCommand(installCmd)
+
+       uninstallCmd := cluster.UninstallCmd(ctx)
+       rootCmd.AddCommand(uninstallCmd)
+
+       upgradeCmd := cluster.UpgradeCmd(ctx)
+       rootCmd.AddCommand(upgradeCmd)
+       
        AddFlags(installCmd)
        hideFlags(installCmd, cli.NamespaceFlag, cli.DubboNamespaceFlag, 
cli.ChartFlag)
        return rootCmd
diff --git a/operator/cmd/cluster/install.go b/operator/cmd/cluster/install.go
index deb5426f..383c328c 100644
--- a/operator/cmd/cluster/install.go
+++ b/operator/cmd/cluster/install.go
@@ -9,7 +9,7 @@ import (
        "time"
 )
 
-type InstallArgs struct {
+type installArgs struct {
        Files            []string
        Sets             []string
        Revision         string
@@ -18,7 +18,7 @@ type InstallArgs struct {
        ReadinessTimeout time.Duration
 }
 
-func (i *InstallArgs) String() string {
+func (i *installArgs) String() string {
        var b strings.Builder
        b.WriteString("Files:    " + (fmt.Sprint(i.Files) + "\n"))
        b.WriteString("Sets:    " + (fmt.Sprint(i.Sets) + "\n"))
@@ -28,10 +28,10 @@ func (i *InstallArgs) String() string {
 }
 
 func InstallCmd(ctx cli.Context) *cobra.Command {
-       return InstallCmdWithArgs(ctx, &RootArgs{}, &InstallArgs{})
+       return InstallCmdWithArgs(ctx, &RootArgs{}, &installArgs{})
 }
 
-func InstallCmdWithArgs(ctx cli.Context, rootArgs *RootArgs, iArgs 
*InstallArgs) *cobra.Command {
+func InstallCmdWithArgs(ctx cli.Context, rootArgs *RootArgs, iArgs 
*installArgs) *cobra.Command {
        ic := &cobra.Command{
                Use:   "install",
                Short: "Applies an Dubbo manifest, installing or reconfiguring 
Dubbo on a cluster",
@@ -52,6 +52,6 @@ func InstallCmdWithArgs(ctx cli.Context, rootArgs *RootArgs, 
iArgs *InstallArgs)
        return ic
 }
 
-func install(kubeClient kube.CLIClient, rootArgs *RootArgs, iArgs 
*InstallArgs) error {
+func install(kubeClient kube.CLIClient, rootArgs *RootArgs, iArgs 
*installArgs) error {
        return nil
 }
diff --git a/operator/cmd/cluster/uninstall.go 
b/operator/cmd/cluster/uninstall.go
new file mode 100644
index 00000000..ef0115ae
--- /dev/null
+++ b/operator/cmd/cluster/uninstall.go
@@ -0,0 +1,17 @@
+package cluster
+
+import (
+       "github.com/apache/dubbo-kubernetes/dubboctl/pkg/cli"
+       "github.com/spf13/cobra"
+)
+
+type uninstallArgs struct {
+}
+
+func addUninstallFlags() {
+
+}
+
+func UninstallCmd(ctx cli.Context) *cobra.Command {
+       return nil
+}
diff --git a/operator/cmd/cluster/upgrade.go b/operator/cmd/cluster/upgrade.go
new file mode 100644
index 00000000..f3ff4fd1
--- /dev/null
+++ b/operator/cmd/cluster/upgrade.go
@@ -0,0 +1,14 @@
+package cluster
+
+import (
+       "github.com/apache/dubbo-kubernetes/dubboctl/pkg/cli"
+       "github.com/spf13/cobra"
+)
+
+type upgradeArgs struct {
+       *installArgs
+}
+
+func UpgradeCmd(ctx cli.Context) *cobra.Command {
+       return nil
+}

Reply via email to