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 a2dd3500 [dubboctl] Add repo command (#552)
a2dd3500 is described below
commit a2dd350054530b22797b3cf8aec8a322367b4bce
Author: Jian Zhong <[email protected]>
AuthorDate: Sat Jan 18 13:19:30 2025 +0800
[dubboctl] Add repo command (#552)
---
dubboctl/cmd/repo.go | 29 +++++++++++++++++++++++++++++
dubboctl/cmd/root.go | 4 ++++
2 files changed, 33 insertions(+)
diff --git a/dubboctl/cmd/repo.go b/dubboctl/cmd/repo.go
new file mode 100644
index 00000000..92951256
--- /dev/null
+++ b/dubboctl/cmd/repo.go
@@ -0,0 +1,29 @@
+package cmd
+
+import (
+ "github.com/apache/dubbo-kubernetes/dubboctl/pkg/cli"
+ "github.com/apache/dubbo-kubernetes/operator/cmd/cluster"
+ "github.com/spf13/cobra"
+)
+
+type repoArgs struct {
+}
+
+func addRepoFlags(cmd *cobra.Command, rArgs *repoArgs) {
+}
+
+func RepoCmd(_ cli.Context, cmd *cobra.Command, clientFactory ClientFactory)
*cobra.Command {
+ rootArgs := &cluster.RootArgs{}
+ rArgs := &repoArgs{}
+ rc := &cobra.Command{
+ Use: "repo",
+ Short: "",
+ Long: "",
+ RunE: func(cmd *cobra.Command, args []string) error {
+ return nil
+ },
+ }
+ cluster.AddFlags(rc, rootArgs)
+ addRepoFlags(rc, rArgs)
+ return rc
+}
diff --git a/dubboctl/cmd/root.go b/dubboctl/cmd/root.go
index 9c993c18..a2870968 100644
--- a/dubboctl/cmd/root.go
+++ b/dubboctl/cmd/root.go
@@ -89,6 +89,10 @@ func GetRootCmd(args []string) *cobra.Command {
createCmd := CreateCmd(ctx, rootCmd, factory)
rootCmd.AddCommand(createCmd)
hideFlags(createCmd, cli.NamespaceFlag, cli.DubboNamespaceFlag,
cli.ChartFlag)
+
+ repoCmd := RepoCmd(ctx, rootCmd, factory)
+ rootCmd.AddCommand(repoCmd)
+ hideFlags(createCmd, cli.NamespaceFlag, cli.DubboNamespaceFlag,
cli.ChartFlag)
return rootCmd
}