diff --git a/dubboctl/cmd/root.go b/dubboctl/cmd/root.go index 68689603..403eee14 100644 --- a/dubboctl/cmd/root.go +++ b/dubboctl/cmd/root.go @@ -95,7 +95,11 @@ func GetRootCmd(args []string) *cobra.Command { repoCmd := RepoCmd(ctx, rootCmd, factory) rootCmd.AddCommand(repoCmd) - hideFlags(createCmd, cli.NamespaceFlag, cli.DubboNamespaceFlag, cli.ChartFlag) + hideFlags(repoCmd, cli.NamespaceFlag, cli.DubboNamespaceFlag, cli.ChartFlag) + + profileCmd := cluster.ProfileCmd(ctx) + rootCmd.AddCommand(profileCmd) + hideFlags(profileCmd, cli.NamespaceFlag, cli.DubboNamespaceFlag, cli.ChartFlag) return rootCmd } diff --git a/operator/cmd/cluster/profile.go b/operator/cmd/cluster/profile.go new file mode 100644 index 00000000..d377b7c5 --- /dev/null +++ b/operator/cmd/cluster/profile.go @@ -0,0 +1,19 @@ +package cluster + +import ( + "github.com/apache/dubbo-kubernetes/dubboctl/pkg/cli" + "github.com/spf13/cobra" +) + +func ProfileCmd(ctx cli.Context) *cobra.Command { + rootArgs := &RootArgs{} + pc := &cobra.Command{ + Use: "profile", + Short: "Commands related to Dubbo configuration profiles", + Long: "The profile command lists, dumps or diffs Dubbo configuration profiles.", + Example: "dubboctl profile list\n" + + "dubboctl install --set profile=demo # Use a profile from the list", + } + AddFlags(pc, rootArgs) + return pc +}