Skip to content

Commit

Permalink
chore(cmd): deprecate CLIs subcommands
Browse files Browse the repository at this point in the history
  • Loading branch information
squakez committed Aug 19, 2024
1 parent 3bb6a5b commit 13867ad
Show file tree
Hide file tree
Showing 10 changed files with 51 additions and 41 deletions.
7 changes: 4 additions & 3 deletions pkg/cmd/describe.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)))
Expand Down
11 changes: 6 additions & 5 deletions pkg/cmd/describe_integration.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
11 changes: 6 additions & 5 deletions pkg/cmd/describe_kamelet.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
11 changes: 6 additions & 5 deletions pkg/cmd/describe_kit.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
11 changes: 6 additions & 5 deletions pkg/cmd/describe_platform.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
7 changes: 4 additions & 3 deletions pkg/cmd/kamelet.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)))
Expand Down
9 changes: 5 additions & 4 deletions pkg/cmd/kamelet_add_repo.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
7 changes: 4 additions & 3 deletions pkg/cmd/kamelet_delete.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
9 changes: 5 additions & 4 deletions pkg/cmd/kamelet_get.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
9 changes: 5 additions & 4 deletions pkg/cmd/kamelet_remove_repo.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 13867ad

Please sign in to comment.