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 11c22146 [dubboctl] add image command (#564)
11c22146 is described below
commit 11c221468118439516e736f986a30b255618412f
Author: Jian Zhong <[email protected]>
AuthorDate: Mon Jan 27 16:30:27 2025 +0800
[dubboctl] add image command (#564)
---
dubboctl/cmd/image.go | 34 ++++++++++++++++++++++++++++++++++
dubboctl/cmd/root.go | 6 ++++++
2 files changed, 40 insertions(+)
diff --git a/dubboctl/cmd/image.go b/dubboctl/cmd/image.go
new file mode 100644
index 00000000..63f34614
--- /dev/null
+++ b/dubboctl/cmd/image.go
@@ -0,0 +1,34 @@
+package cmd
+
+import (
+ "github.com/apache/dubbo-kubernetes/dubboctl/pkg/cli"
+ "github.com/spf13/cobra"
+)
+
+func ImageCmd(ctx cli.Context, cmd *cobra.Command, clientFactory
ClientFactory) *cobra.Command {
+ ibc := imageBuildCmd(cmd, clientFactory)
+ ipc := imageBuildCmd(cmd, clientFactory)
+ iac := imageApplyCmd(cmd, clientFactory)
+
+ ic := &cobra.Command{
+ Use: "image",
+ Short: "",
+ Long: "",
+ }
+ ic.AddCommand(ibc)
+ ic.AddCommand(ipc)
+ ic.AddCommand(iac)
+ return ic
+}
+
+func imageBuildCmd(cmd *cobra.Command, clientFactory ClientFactory)
*cobra.Command {
+ return nil
+}
+
+func imagePushCmd(cmd *cobra.Command, clientFactory ClientFactory)
*cobra.Command {
+ return nil
+}
+
+func imageApplyCmd(cmd *cobra.Command, clientFactory ClientFactory)
*cobra.Command {
+ return nil
+}
diff --git a/dubboctl/cmd/root.go b/dubboctl/cmd/root.go
index 403eee14..43c0b660 100644
--- a/dubboctl/cmd/root.go
+++ b/dubboctl/cmd/root.go
@@ -100,7 +100,13 @@ func GetRootCmd(args []string) *cobra.Command {
profileCmd := cluster.ProfileCmd(ctx)
rootCmd.AddCommand(profileCmd)
hideFlags(profileCmd, cli.NamespaceFlag, cli.DubboNamespaceFlag,
cli.ChartFlag)
+
+ imageCmd := ImageCmd(ctx, rootCmd, factory)
+ rootCmd.AddCommand(imageCmd)
+ hideFlags(imageCmd, cli.NamespaceFlag, cli.DubboNamespaceFlag,
cli.ChartFlag)
+
return rootCmd
+
}
func hideFlags(origin *cobra.Command, hide ...string) {