diff --git a/cmd/kyma/alpha/enable/enable.go b/cmd/kyma/alpha/add/add.go similarity index 63% rename from cmd/kyma/alpha/enable/enable.go rename to cmd/kyma/alpha/add/add.go index f70ecf153..5806cc403 100644 --- a/cmd/kyma/alpha/enable/enable.go +++ b/cmd/kyma/alpha/add/add.go @@ -1,15 +1,16 @@ -package enable +package add import ( - "github.com/kyma-project/cli/cmd/kyma/alpha/enable/module" + "github.com/kyma-project/cli/cmd/kyma/alpha/add/module" "github.com/kyma-project/cli/internal/cli" "github.com/spf13/cobra" ) func NewCmd(o *cli.Options) *cobra.Command { cmd := &cobra.Command{ - Use: "enable", - Short: "Enables a resource in the Kyma cluster.", + Use: "add", + Aliases: []string{"enable"}, + Short: "Adds a resource to the Kyma cluster.", Long: `Use this command to enable a resource in the Kyma cluster. `, } diff --git a/cmd/kyma/alpha/enable/module/mock/mock_interactor.go b/cmd/kyma/alpha/add/module/mock/mock_interactor.go similarity index 100% rename from cmd/kyma/alpha/enable/module/mock/mock_interactor.go rename to cmd/kyma/alpha/add/module/mock/mock_interactor.go diff --git a/cmd/kyma/alpha/enable/module/module.go b/cmd/kyma/alpha/add/module/module.go similarity index 95% rename from cmd/kyma/alpha/enable/module/module.go rename to cmd/kyma/alpha/add/module/module.go index 398e52321..022f0ad81 100644 --- a/cmd/kyma/alpha/enable/module/module.go +++ b/cmd/kyma/alpha/add/module/module.go @@ -31,8 +31,8 @@ func NewCmd(o *Options) *cobra.Command { cmd := &cobra.Command{ Use: "module [name] [flags]", - Short: "Enables a module in the cluster or in the given Kyma resource.", - Long: `Use this command to enable Kyma modules available in the cluster. + Short: "Adds a module in the cluster or in the given Kyma resource.", + Long: `Use this command to add Kyma modules available in the cluster. ### Detailed description @@ -43,8 +43,8 @@ A module is available when it is released with a ModuleTemplate. The ModuleTempl `, Example: ` -Enable "my-module" from "alpha" channel in "default-kyma" in "kyma-system" Namespace - kyma alpha enable module my-module -c alpha -n kyma-system -k default-kyma +Add "my-module" from "alpha" channel to "default-kyma" in "kyma-system" Namespace + kyma alpha add module my-module -c alpha -n kyma-system -k default-kyma `, RunE: func(cmd *cobra.Command, args []string) error { return c.Run(cmd.Context(), args) }, Aliases: []string{"mod", "mods", "modules"}, diff --git a/cmd/kyma/alpha/enable/module/module_test.go b/cmd/kyma/alpha/add/module/module_test.go similarity index 97% rename from cmd/kyma/alpha/enable/module/module_test.go rename to cmd/kyma/alpha/add/module/module_test.go index ff6d9ff50..102730563 100644 --- a/cmd/kyma/alpha/enable/module/module_test.go +++ b/cmd/kyma/alpha/add/module/module_test.go @@ -7,7 +7,7 @@ import ( "github.com/kyma-project/lifecycle-manager/api/v1beta2" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - "github.com/kyma-project/cli/cmd/kyma/alpha/enable/module/mock" + "github.com/kyma-project/cli/cmd/kyma/alpha/add/module/mock" "github.com/kyma-project/cli/internal/cli/alpha/module" ) diff --git a/cmd/kyma/alpha/enable/module/opts.go b/cmd/kyma/alpha/add/module/opts.go similarity index 100% rename from cmd/kyma/alpha/enable/module/opts.go rename to cmd/kyma/alpha/add/module/opts.go diff --git a/cmd/kyma/alpha/enable/module/opts_test.go b/cmd/kyma/alpha/add/module/opts_test.go similarity index 100% rename from cmd/kyma/alpha/enable/module/opts_test.go rename to cmd/kyma/alpha/add/module/opts_test.go diff --git a/cmd/kyma/alpha/alpha.go b/cmd/kyma/alpha/alpha.go index dcb8e7a12..ebf326d92 100755 --- a/cmd/kyma/alpha/alpha.go +++ b/cmd/kyma/alpha/alpha.go @@ -1,10 +1,10 @@ package alpha import ( + "github.com/kyma-project/cli/cmd/kyma/alpha/add" "github.com/kyma-project/cli/cmd/kyma/alpha/create" + "github.com/kyma-project/cli/cmd/kyma/alpha/delete" "github.com/kyma-project/cli/cmd/kyma/alpha/deploy" - "github.com/kyma-project/cli/cmd/kyma/alpha/disable" - "github.com/kyma-project/cli/cmd/kyma/alpha/enable" "github.com/kyma-project/cli/cmd/kyma/alpha/list" "github.com/kyma-project/cli/cmd/kyma/alpha/sign" "github.com/kyma-project/cli/cmd/kyma/alpha/verify" @@ -23,8 +23,8 @@ func NewCmd(o *cli.Options) *cobra.Command { cmd.AddCommand(create.NewCmd(o)) cmd.AddCommand(list.NewCmd(o)) - cmd.AddCommand(enable.NewCmd(o)) - cmd.AddCommand(disable.NewCmd(o)) + cmd.AddCommand(add.NewCmd(o)) + cmd.AddCommand(delete.NewCmd(o)) cmd.AddCommand(deploy.NewCmd(deploy.NewOptions(o))) cmd.AddCommand(sign.NewCmd(o)) cmd.AddCommand(verify.NewCmd(o)) diff --git a/cmd/kyma/alpha/disable/disable.go b/cmd/kyma/alpha/delete/delete.go similarity index 61% rename from cmd/kyma/alpha/disable/disable.go rename to cmd/kyma/alpha/delete/delete.go index b5f2700a4..87abd5bad 100644 --- a/cmd/kyma/alpha/disable/disable.go +++ b/cmd/kyma/alpha/delete/delete.go @@ -1,15 +1,16 @@ -package disable +package delete import ( - "github.com/kyma-project/cli/cmd/kyma/alpha/disable/module" + "github.com/kyma-project/cli/cmd/kyma/alpha/delete/module" "github.com/kyma-project/cli/internal/cli" "github.com/spf13/cobra" ) func NewCmd(o *cli.Options) *cobra.Command { cmd := &cobra.Command{ - Use: "disable", - Short: "Disables a resource in the Kyma cluster.", + Use: "delete", + Aliases: []string{"disable"}, + Short: "Deletes a resource from the Kyma cluster.", Long: `Use this command to disable a resource in the Kyma cluster. `, } diff --git a/cmd/kyma/alpha/disable/module/module.go b/cmd/kyma/alpha/delete/module/module.go similarity index 92% rename from cmd/kyma/alpha/disable/module/module.go rename to cmd/kyma/alpha/delete/module/module.go index 33a2448bd..7510e3af4 100644 --- a/cmd/kyma/alpha/disable/module/module.go +++ b/cmd/kyma/alpha/delete/module/module.go @@ -29,8 +29,8 @@ func NewCmd(o *Options) *cobra.Command { cmd := &cobra.Command{ Use: "module [name] [flags]", - Short: "Disables a module in the cluster or in the given Kyma resource.", - Long: `Use this command to disable active Kyma modules in the cluster. + Short: "Deletes a module from the cluster or the given Kyma resource.", + Long: `Use this command to delete Kyma modules from the cluster. ### Detailed description @@ -40,8 +40,8 @@ This command disables an active module in the cluster. `, Example: ` -Disable "my-module" from the "alpha" channel in "default-kyma" in "kyma-system" Namespace - kyma alpha disable module my-module -c alpha -n kyma-system -k default-kyma +Delete "my-module" from the "alpha" channel from "default-kyma" in "kyma-system" Namespace + kyma alpha delete module my-module -c alpha -n kyma-system -k default-kyma `, RunE: func(cmd *cobra.Command, args []string) error { return c.Run(cmd.Context(), args) }, Aliases: []string{"mod", "mods", "modules"}, diff --git a/cmd/kyma/alpha/disable/module/module_test.go b/cmd/kyma/alpha/delete/module/module_test.go similarity index 100% rename from cmd/kyma/alpha/disable/module/module_test.go rename to cmd/kyma/alpha/delete/module/module_test.go diff --git a/cmd/kyma/alpha/disable/module/opts.go b/cmd/kyma/alpha/delete/module/opts.go similarity index 100% rename from cmd/kyma/alpha/disable/module/opts.go rename to cmd/kyma/alpha/delete/module/opts.go diff --git a/docs/gen-docs/kyma_alpha.md b/docs/gen-docs/kyma_alpha.md index 221adcfdd..168e9ec30 100644 --- a/docs/gen-docs/kyma_alpha.md +++ b/docs/gen-docs/kyma_alpha.md @@ -22,10 +22,10 @@ Alpha commands are experimental, unreleased features that should only be used by ## See also * [kyma](kyma.md) - Controls a Kyma cluster. +* [kyma alpha add](kyma_alpha_add.md) - Adds a resource to the Kyma cluster. * [kyma alpha create](kyma_alpha_create.md) - Creates resources on the Kyma cluster. +* [kyma alpha delete](kyma_alpha_delete.md) - Deletes a resource from the Kyma cluster. * [kyma alpha deploy](kyma_alpha_deploy.md) - Deploys Kyma on a running Kubernetes cluster. -* [kyma alpha disable](kyma_alpha_disable.md) - Disables a resource in the Kyma cluster. -* [kyma alpha enable](kyma_alpha_enable.md) - Enables a resource in the Kyma cluster. * [kyma alpha list](kyma_alpha_list.md) - Lists resources on the Kyma cluster. * [kyma alpha sign](kyma_alpha_sign.md) - Signs all module resources from an unsigned module component descriptor that's hosted in a remote OCI registry * [kyma alpha verify](kyma_alpha_verify.md) - Verifies all module resources from a signed module component descriptor that's hosted in a remote OCI registry diff --git a/docs/gen-docs/kyma_alpha_enable.md b/docs/gen-docs/kyma_alpha_add.md similarity index 81% rename from docs/gen-docs/kyma_alpha_enable.md rename to docs/gen-docs/kyma_alpha_add.md index b9ad667f1..0d3cd4c3f 100644 --- a/docs/gen-docs/kyma_alpha_enable.md +++ b/docs/gen-docs/kyma_alpha_add.md @@ -1,8 +1,8 @@ --- -title: kyma alpha enable +title: kyma alpha add --- -Enables a resource in the Kyma cluster. +Adds a resource to the Kyma cluster. ## Synopsis @@ -22,5 +22,5 @@ Use this command to enable a resource in the Kyma cluster. ## See also * [kyma alpha](kyma_alpha.md) - Experimental commands -* [kyma alpha enable module](kyma_alpha_enable_module.md) - Enables a module in the cluster or in the given Kyma resource. +* [kyma alpha add module](kyma_alpha_add_module.md) - Adds a module in the cluster or in the given Kyma resource. diff --git a/docs/gen-docs/kyma_alpha_enable_module.md b/docs/gen-docs/kyma_alpha_add_module.md similarity index 80% rename from docs/gen-docs/kyma_alpha_enable_module.md rename to docs/gen-docs/kyma_alpha_add_module.md index 2e0bcb06b..bed62498e 100644 --- a/docs/gen-docs/kyma_alpha_enable_module.md +++ b/docs/gen-docs/kyma_alpha_add_module.md @@ -1,12 +1,12 @@ --- -title: kyma alpha enable module +title: kyma alpha add module --- -Enables a module in the cluster or in the given Kyma resource. +Adds a module in the cluster or in the given Kyma resource. ## Synopsis -Use this command to enable Kyma modules available in the cluster. +Use this command to add Kyma modules available in the cluster. ### Detailed description @@ -17,15 +17,15 @@ A module is available when it is released with a ModuleTemplate. The ModuleTempl ```bash -kyma alpha enable module [name] [flags] +kyma alpha add module [name] [flags] ``` ## Examples ```bash -Enable "my-module" from "alpha" channel in "default-kyma" in "kyma-system" Namespace - kyma alpha enable module my-module -c alpha -n kyma-system -k default-kyma +Add "my-module" from "alpha" channel to "default-kyma" in "kyma-system" Namespace + kyma alpha add module my-module -c alpha -n kyma-system -k default-kyma ``` @@ -53,5 +53,5 @@ Enable "my-module" from "alpha" channel in "default-kyma" in "kyma-system" Names ## See also -* [kyma alpha enable](kyma_alpha_enable.md) - Enables a resource in the Kyma cluster. +* [kyma alpha add](kyma_alpha_add.md) - Adds a resource to the Kyma cluster. diff --git a/docs/gen-docs/kyma_alpha_disable.md b/docs/gen-docs/kyma_alpha_delete.md similarity index 81% rename from docs/gen-docs/kyma_alpha_disable.md rename to docs/gen-docs/kyma_alpha_delete.md index aaa6416c9..d6e4cce63 100644 --- a/docs/gen-docs/kyma_alpha_disable.md +++ b/docs/gen-docs/kyma_alpha_delete.md @@ -1,8 +1,8 @@ --- -title: kyma alpha disable +title: kyma alpha delete --- -Disables a resource in the Kyma cluster. +Deletes a resource from the Kyma cluster. ## Synopsis @@ -22,5 +22,5 @@ Use this command to disable a resource in the Kyma cluster. ## See also * [kyma alpha](kyma_alpha.md) - Experimental commands -* [kyma alpha disable module](kyma_alpha_disable_module.md) - Disables a module in the cluster or in the given Kyma resource. +* [kyma alpha delete module](kyma_alpha_delete_module.md) - Deletes a module from the cluster or the given Kyma resource. diff --git a/docs/gen-docs/kyma_alpha_disable_module.md b/docs/gen-docs/kyma_alpha_delete_module.md similarity index 76% rename from docs/gen-docs/kyma_alpha_disable_module.md rename to docs/gen-docs/kyma_alpha_delete_module.md index 21f1c3602..c9a99128a 100644 --- a/docs/gen-docs/kyma_alpha_disable_module.md +++ b/docs/gen-docs/kyma_alpha_delete_module.md @@ -1,12 +1,12 @@ --- -title: kyma alpha disable module +title: kyma alpha delete module --- -Disables a module in the cluster or in the given Kyma resource. +Deletes a module from the cluster or the given Kyma resource. ## Synopsis -Use this command to disable active Kyma modules in the cluster. +Use this command to delete Kyma modules from the cluster. ### Detailed description @@ -16,15 +16,15 @@ This command disables an active module in the cluster. ```bash -kyma alpha disable module [name] [flags] +kyma alpha delete module [name] [flags] ``` ## Examples ```bash -Disable "my-module" from the "alpha" channel in "default-kyma" in "kyma-system" Namespace - kyma alpha disable module my-module -c alpha -n kyma-system -k default-kyma +Delete "my-module" from the "alpha" channel from "default-kyma" in "kyma-system" Namespace + kyma alpha delete module my-module -c alpha -n kyma-system -k default-kyma ``` @@ -51,5 +51,5 @@ Disable "my-module" from the "alpha" channel in "default-kyma" in "kyma-system" ## See also -* [kyma alpha disable](kyma_alpha_disable.md) - Disables a resource in the Kyma cluster. +* [kyma alpha delete](kyma_alpha_delete.md) - Deletes a resource from the Kyma cluster. diff --git a/internal/net/net_test.go b/internal/net/net_test.go index 7bbf99056..c4ae121d0 100644 --- a/internal/net/net_test.go +++ b/internal/net/net_test.go @@ -23,7 +23,7 @@ func TestDoGet(t *testing.T) { require.Equal(t, 301, sc) // Non existing URL - _, err = DoGet("http://fake-url.com") + _, err = DoGet("http://totally.fake.url") require.Error(t, err) // BAD URL