From 13867ad81b087089cf7a5b00d2aecc9c5c13981a Mon Sep 17 00:00:00 2001 From: Pasquale Congiusti Date: Mon, 19 Aug 2024 10:35:24 +0200 Subject: [PATCH] chore(cmd): deprecate CLIs subcommands --- pkg/cmd/describe.go | 7 ++++--- pkg/cmd/describe_integration.go | 11 ++++++----- pkg/cmd/describe_kamelet.go | 11 ++++++----- pkg/cmd/describe_kit.go | 11 ++++++----- pkg/cmd/describe_platform.go | 11 ++++++----- pkg/cmd/kamelet.go | 7 ++++--- pkg/cmd/kamelet_add_repo.go | 9 +++++---- pkg/cmd/kamelet_delete.go | 7 ++++--- pkg/cmd/kamelet_get.go | 9 +++++---- pkg/cmd/kamelet_remove_repo.go | 9 +++++---- 10 files changed, 51 insertions(+), 41 deletions(-) diff --git a/pkg/cmd/describe.go b/pkg/cmd/describe.go index a22f9a0416..54a6d355f4 100644 --- a/pkg/cmd/describe.go +++ b/pkg/cmd/describe.go @@ -75,9 +75,10 @@ func describeTraits(w *indentedwriter.Writer, traits interface{}) error { func newCmdDescribe(rootCmdOptions *RootCmdOptions) *cobra.Command { cmd := cobra.Command{ - Use: "describe", - Short: "Describe a resource", - Long: `Describe a Camel K resource.`, + Use: "describe", + Deprecated: "consider using kubectl (or oc) custom resource describe command instead.", + Short: "Describe a resource", + Long: `Describe a Camel K resource.`, } cmd.AddCommand(cmdOnly(newDescribeKitCmd(rootCmdOptions))) diff --git a/pkg/cmd/describe_integration.go b/pkg/cmd/describe_integration.go index 5917173b97..0da07b9478 100644 --- a/pkg/cmd/describe_integration.go +++ b/pkg/cmd/describe_integration.go @@ -37,11 +37,12 @@ func newDescribeIntegrationCmd(rootCmdOptions *RootCmdOptions) (*cobra.Command, } cmd := cobra.Command{ - Use: "integration", - Aliases: []string{"it"}, - Short: "Describe an Integration", - Long: `Describe an Integration.`, - PreRunE: decode(&options, options.Flags), + Use: "integration", + Aliases: []string{"it"}, + Short: "Describe an Integration", + Long: `Describe an Integration.`, + Deprecated: "consider using kubectl (or oc) custom resource describe command instead.", + PreRunE: decode(&options, options.Flags), RunE: func(cmd *cobra.Command, args []string) error { if err := options.validate(cmd, args); err != nil { return err diff --git a/pkg/cmd/describe_kamelet.go b/pkg/cmd/describe_kamelet.go index a0464c8e1f..691719b574 100644 --- a/pkg/cmd/describe_kamelet.go +++ b/pkg/cmd/describe_kamelet.go @@ -38,11 +38,12 @@ func newDescribeKameletCmd(rootCmdOptions *RootCmdOptions) (*cobra.Command, *des } cmd := cobra.Command{ - Use: "kamelet", - Aliases: []string{"kl"}, - Short: "Describe a Kamelet", - Long: `Describe a Kamelet.`, - PreRunE: decode(&options, options.Flags), + Use: "kamelet", + Aliases: []string{"kl"}, + Short: "Describe a Kamelet", + Long: `Describe a Kamelet.`, + Deprecated: "consider using kubectl (or oc) custom resource describe command instead.", + PreRunE: decode(&options, options.Flags), RunE: func(cmd *cobra.Command, args []string) error { if err := options.validate(cmd, args); err != nil { return err diff --git a/pkg/cmd/describe_kit.go b/pkg/cmd/describe_kit.go index ea5346e822..d5abffced2 100644 --- a/pkg/cmd/describe_kit.go +++ b/pkg/cmd/describe_kit.go @@ -36,11 +36,12 @@ func newDescribeKitCmd(rootCmdOptions *RootCmdOptions) (*cobra.Command, *describ } cmd := cobra.Command{ - Use: "kit", - Aliases: []string{"ik"}, - Short: "Describe an Integration Kit", - Long: `Describe an Integration Kit.`, - PreRunE: decode(&options, options.Flags), + Use: "kit", + Aliases: []string{"ik"}, + Short: "Describe an Integration Kit", + Long: `Describe an Integration Kit.`, + Deprecated: "consider using kubectl (or oc) custom resource describe command instead.", + PreRunE: decode(&options, options.Flags), RunE: func(cmd *cobra.Command, args []string) error { if err := options.validate(cmd, args); err != nil { return err diff --git a/pkg/cmd/describe_platform.go b/pkg/cmd/describe_platform.go index 72692e3b1e..2979dee743 100644 --- a/pkg/cmd/describe_platform.go +++ b/pkg/cmd/describe_platform.go @@ -36,11 +36,12 @@ func newDescribePlatformCmd(rootCmdOptions *RootCmdOptions) (*cobra.Command, *de } cmd := cobra.Command{ - Use: "platform", - Aliases: []string{"ip"}, - Short: "Describe an Integration Platform", - Long: `Describe an Integration Platform.`, - PreRunE: decode(&options, options.Flags), + Use: "platform", + Aliases: []string{"ip"}, + Short: "Describe an Integration Platform", + Long: `Describe an Integration Platform.`, + Deprecated: "consider using kubectl (or oc) custom resource describe command instead.", + PreRunE: decode(&options, options.Flags), RunE: func(cmd *cobra.Command, args []string) error { if err := options.validate(cmd, args); err != nil { return err diff --git a/pkg/cmd/kamelet.go b/pkg/cmd/kamelet.go index 8b1f48b969..fbe14f20b1 100644 --- a/pkg/cmd/kamelet.go +++ b/pkg/cmd/kamelet.go @@ -23,9 +23,10 @@ import ( func newCmdKamelet(rootCmdOptions *RootCmdOptions) *cobra.Command { cmd := cobra.Command{ - Use: "kamelet", - Short: "Configure a Kamelet", - Long: `Configure a Kamelet.`, + Use: "kamelet", + Short: "Configure a Kamelet", + Long: `Configure a Kamelet.`, + Deprecated: "consider using kubectl (or oc) command instead.", } cmd.AddCommand(cmdOnly(newKameletGetCmd(rootCmdOptions))) diff --git a/pkg/cmd/kamelet_add_repo.go b/pkg/cmd/kamelet_add_repo.go index f217b01a8e..3ccf7e062b 100644 --- a/pkg/cmd/kamelet_add_repo.go +++ b/pkg/cmd/kamelet_add_repo.go @@ -40,10 +40,11 @@ func newKameletAddRepoCmd(rootCmdOptions *RootCmdOptions) (*cobra.Command, *kame } cmd := cobra.Command{ - Use: "add-repo github:owner/repo[/path_to_kamelets_folder][@version] ...", - Short: "Add a Kamelet repository", - Long: `Add a Kamelet repository.`, - PreRunE: decode(&options, options.Flags), + Use: "add-repo github:owner/repo[/path_to_kamelets_folder][@version] ...", + Short: "Add a Kamelet repository", + Long: `Add a Kamelet repository.`, + Deprecated: "consider using kubectl (or oc) command instead.", + PreRunE: decode(&options, options.Flags), RunE: func(cmd *cobra.Command, args []string) error { if err := options.validate(args); err != nil { return err diff --git a/pkg/cmd/kamelet_delete.go b/pkg/cmd/kamelet_delete.go index 408ca3fdb4..ee83f558a3 100644 --- a/pkg/cmd/kamelet_delete.go +++ b/pkg/cmd/kamelet_delete.go @@ -35,9 +35,10 @@ func newKameletDeleteCmd(rootCmdOptions *RootCmdOptions) (*cobra.Command, *kamel } cmd := cobra.Command{ - Use: "delete [Kamelet1] [Kamelet2] ...", - Short: "Delete Kamelets deployed on Kubernetes", - PreRunE: decode(&options, options.Flags), + Use: "delete [Kamelet1] [Kamelet2] ...", + Short: "Delete Kamelets deployed on Kubernetes", + Deprecated: "consider using kubectl (or oc) command instead.", + PreRunE: decode(&options, options.Flags), RunE: func(cmd *cobra.Command, args []string) error { if err := options.validate(args); err != nil { return err diff --git a/pkg/cmd/kamelet_get.go b/pkg/cmd/kamelet_get.go index 0f2e833514..ce5a31bf4d 100644 --- a/pkg/cmd/kamelet_get.go +++ b/pkg/cmd/kamelet_get.go @@ -36,10 +36,11 @@ func newKameletGetCmd(rootCmdOptions *RootCmdOptions) (*cobra.Command, *kameletG } cmd := cobra.Command{ - Use: "get", - Short: "Get defined Kamelet", - Long: `Get defined Kamelet.`, - PreRunE: decode(&options, options.Flags), + Use: "get", + Short: "Get defined Kamelet", + Long: `Get defined Kamelet.`, + Deprecated: "consider using kubectl (or oc) command instead.", + PreRunE: decode(&options, options.Flags), RunE: func(cmd *cobra.Command, args []string) error { if err := options.validate(); err != nil { return err diff --git a/pkg/cmd/kamelet_remove_repo.go b/pkg/cmd/kamelet_remove_repo.go index f521d27e36..869c214140 100644 --- a/pkg/cmd/kamelet_remove_repo.go +++ b/pkg/cmd/kamelet_remove_repo.go @@ -33,10 +33,11 @@ func newKameletRemoveRepoCmd(rootCmdOptions *RootCmdOptions) (*cobra.Command, *k } cmd := cobra.Command{ - Use: "remove-repo github:owner/repo[/path_to_kamelets_folder][@version] ...", - Short: "Remove a Kamelet repository", - Long: `Remove a Kamelet repository.`, - PreRunE: decode(&options, options.Flags), + Use: "remove-repo github:owner/repo[/path_to_kamelets_folder][@version] ...", + Short: "Remove a Kamelet repository", + Long: `Remove a Kamelet repository.`, + Deprecated: "consider using kubectl (or oc) command instead.", + PreRunE: decode(&options, options.Flags), RunE: func(cmd *cobra.Command, args []string) error { if err := options.validate(args); err != nil { return err