From c86b88941c6eecae3db1b9029674864fe03efa59 Mon Sep 17 00:00:00 2001 From: mfordjody <11638005@qq.com> Date: Wed, 27 Nov 2024 18:30:36 +0800 Subject: [PATCH] [operator] update installcmd logic --- operator/cmd/cluster/install.go | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) diff --git a/operator/cmd/cluster/install.go b/operator/cmd/cluster/install.go index ffe32e2d..dbbc0089 100644 --- a/operator/cmd/cluster/install.go +++ b/operator/cmd/cluster/install.go @@ -3,6 +3,7 @@ package cluster import ( "fmt" "github.com/apache/dubbo-kubernetes/dubboctl/pkg/cli" + "github.com/apache/dubbo-kubernetes/pkg/kube" "github.com/spf13/cobra" "strings" "time" @@ -29,3 +30,28 @@ func (i *InstallArgs) String() string { func InstallCmd(ctx cli.Context) *cobra.Command { return nil } + +func WithInstallCmdArgs(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.", + Long: "The install command generates an Dubbo install manifest and applies it to a cluster.", + Example: `# Apply a default dubboctl installation + dubboctl install + # Apply a default profile + dubboctl install --profile=default`, + Args: cobra.ExactArgs(0), + RunE: func(cmd *cobra.Command, args []string) error { + _, err := ctx.CliClient() + if err != nil { + return err + } + return install(ctx, rootArgs, iArgs) + }, + } + return ic +} + +func install(kubeClient kube.CliClient, rootArgs *RootArgs, iArgs *InstallArgs) error { + return nil +}