Skip to content

Commit

Permalink
rework create resource args
Browse files Browse the repository at this point in the history
  • Loading branch information
pPrecel committed Feb 19, 2025
1 parent a5d3a26 commit c80c47d
Show file tree
Hide file tree
Showing 23 changed files with 581 additions and 660 deletions.
10 changes: 5 additions & 5 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,9 @@ require (
github.com/go-test/deep v1.1.1
github.com/google/go-containerregistry v0.20.3
github.com/itchyny/gojq v0.12.17
github.com/jedib0t/go-pretty/v6 v6.6.6
github.com/kyma-project/api-gateway v0.0.0-20241120132533-7d29d687f9f0
github.com/moby/term v0.5.2
github.com/olekukonko/tablewriter v0.0.5
github.com/pkg/errors v0.9.1
github.com/spf13/cobra v1.8.1
github.com/spf13/pflag v1.0.6
Expand Down Expand Up @@ -172,10 +172,10 @@ require (
golang.org/x/mod v0.22.0 // indirect
golang.org/x/net v0.33.0 // indirect
golang.org/x/oauth2 v0.25.0 // indirect
golang.org/x/sync v0.10.0 // indirect
golang.org/x/sys v0.29.0 // indirect
golang.org/x/term v0.28.0 // indirect
golang.org/x/text v0.21.0 // indirect
golang.org/x/sync v0.11.0 // indirect
golang.org/x/sys v0.30.0 // indirect
golang.org/x/term v0.29.0 // indirect
golang.org/x/text v0.22.0 // indirect
golang.org/x/time v0.8.0 // indirect
gomodules.xyz/jsonpatch/v2 v2.4.0 // indirect
google.golang.org/genproto/googleapis/api v0.0.0-20240827150818-7e3bb234dfed // indirect
Expand Down
17 changes: 10 additions & 7 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -258,6 +258,8 @@ github.com/itchyny/timefmt-go v0.1.6 h1:ia3s54iciXDdzWzwaVKXZPbiXzxxnv1SPGFfM/my
github.com/itchyny/timefmt-go v0.1.6/go.mod h1:RRDZYC5s9ErkjQvTvvU7keJjxUYzIISJGxm9/mAERQg=
github.com/jbenet/go-context v0.0.0-20150711004518-d14ea06fba99 h1:BQSFePA1RWJOlocH6Fxy8MmwDt+yVQYULKfN0RoTN8A=
github.com/jbenet/go-context v0.0.0-20150711004518-d14ea06fba99/go.mod h1:1lJo3i6rXxKeerYnT8Nvf0QmHCRC1n8sfWVwXF2Frvo=
github.com/jedib0t/go-pretty/v6 v6.6.6 h1:LyezkL+1SuqH2z47e5IMQkYUIcs2BD+MnpdPRiRcN0c=
github.com/jedib0t/go-pretty/v6 v6.6.6/go.mod h1:YwC5CE4fJ1HFUDeivSV1r//AmANFHyqczZk+U6BDALU=
github.com/jmespath/go-jmespath v0.0.0-20180206201540-c2b33e8439af/go.mod h1:Nht3zPeWKUH0NzdCt2Blrr5ys8VGpn0CEB0cQHVjt7k=
github.com/jmespath/go-jmespath v0.4.0 h1:BEgLn5cpjn8UN1mAw4NjwDrS35OdebyEtFe+9YPoQUg=
github.com/jmespath/go-jmespath v0.4.0/go.mod h1:T8mJZnbsbmF+m6zOOFylbeCJqk5+pHWvzYPziyZiYoo=
Expand Down Expand Up @@ -304,7 +306,6 @@ github.com/mattn/go-isatty v0.0.8/go.mod h1:Iq45c/XA43vh69/j3iqttzPXn0bhXyGjM0Hd
github.com/mattn/go-isatty v0.0.16/go.mod h1:kYGgaQfpe5nmfYZH+SKPsOc2e4SrIfOl2e/yFXSvRLM=
github.com/mattn/go-isatty v0.0.20 h1:xfD0iDuEKnDkl03q4limB+vH+GxLEtL/jb4xVJSWWEY=
github.com/mattn/go-isatty v0.0.20/go.mod h1:W+V8PltTTMOvKvAeJH7IuucS94S2C6jfK/D7dTCTo3Y=
github.com/mattn/go-runewidth v0.0.9/go.mod h1:H031xJmbD/WCDINGzjvQ9THkh0rPKHF+m2gUSrubnMI=
github.com/mattn/go-runewidth v0.0.13/go.mod h1:Jdepj2loyihRzMpdS35Xk/zdY8IAYHsh153qUoGf23w=
github.com/mattn/go-runewidth v0.0.16 h1:E5ScNMtiwvlvB5paMFdw9p4kSQzbXFikJ5SQO6TULQc=
github.com/mattn/go-runewidth v0.0.16/go.mod h1:Jdepj2loyihRzMpdS35Xk/zdY8IAYHsh153qUoGf23w=
Expand Down Expand Up @@ -346,8 +347,6 @@ github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822/go.mod h1:+n7T8m
github.com/mwitkow/go-conntrack v0.0.0-20161129095857-cc309e4a2223/go.mod h1:qRWi+5nqEBWmkhHvq77mSJWrCKwh8bxhgT7d/eI7P4U=
github.com/mxk/go-flowrate v0.0.0-20140419014527-cca7078d478f h1:y5//uYreIhSUg3J1GEMiLbxo1LJaP8RfCpH6pymGZus=
github.com/mxk/go-flowrate v0.0.0-20140419014527-cca7078d478f/go.mod h1:ZdcZmHo+o7JKHSa8/e818NopupXU1YMK5fe1lsApnBw=
github.com/olekukonko/tablewriter v0.0.5 h1:P2Ga83D34wi1o9J6Wh1mRuqd4mF/x/lgBS7N7AbDhec=
github.com/olekukonko/tablewriter v0.0.5/go.mod h1:hPp6KlRPjbx+hW8ykQs1w3UBbZlj6HuIJcUGPhkA7kY=
github.com/onsi/ginkgo v1.6.0 h1:Ix8l273rp3QzYgXSR+c8d1fTG7UPgYkOSELPhiY/YGw=
github.com/onsi/ginkgo v1.6.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE=
github.com/onsi/ginkgo/v2 v2.21.0 h1:7rg/4f3rB88pb5obDgNZrNHrQ4e6WpjonchcpuBRnZM=
Expand Down Expand Up @@ -541,8 +540,9 @@ golang.org/x/sync v0.1.0/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
golang.org/x/sync v0.3.0/go.mod h1:FU7BRWz2tNW+3quACPkgCx/L+uEAv1htQ0V83Z9Rj+Y=
golang.org/x/sync v0.6.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk=
golang.org/x/sync v0.7.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk=
golang.org/x/sync v0.10.0 h1:3NQrjDixjgGwUOCaF8w2+VYHv0Ve/vGYSbdkTa98gmQ=
golang.org/x/sync v0.10.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk=
golang.org/x/sync v0.11.0 h1:GGz8+XQP4FvTTrjZPzNKTMFtSXH80RAzG+5ghFPgK9w=
golang.org/x/sync v0.11.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk=
golang.org/x/sys v0.0.0-20180905080454-ebe1bf3edb33/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
golang.org/x/sys v0.0.0-20180909124046-d0be0721c37e/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
golang.org/x/sys v0.0.0-20181116152217-5ac8a444bdc5/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
Expand All @@ -568,8 +568,9 @@ golang.org/x/sys v0.8.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.12.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.17.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
golang.org/x/sys v0.20.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
golang.org/x/sys v0.29.0 h1:TPYlXGxvx1MGTn2GiZDhnjPA9wZzZeGKHHmKhHYvgaU=
golang.org/x/sys v0.29.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
golang.org/x/sys v0.30.0 h1:QjkSwP/36a20jFYWkSue1YwXzLmsV5Gfq7Eiy72C1uc=
golang.org/x/sys v0.30.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
golang.org/x/telemetry v0.0.0-20240228155512-f48c80bd79b2/go.mod h1:TeRTkGYfJXctD9OcfyVLyj2J3IxLnKwHJR8f4D8a3YE=
golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo=
golang.org/x/term v0.0.0-20201210144234-2321bbc49cbf/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo=
Expand All @@ -580,8 +581,9 @@ golang.org/x/term v0.8.0/go.mod h1:xPskH00ivmX89bAKVGSKKtLOWNx2+17Eiy94tnKShWo=
golang.org/x/term v0.12.0/go.mod h1:owVbMEjm3cBLCHdkQu9b1opXd4ETQWc3BhuQGKgXgvU=
golang.org/x/term v0.17.0/go.mod h1:lLRBjIVuehSbZlaOtGMbcMncT+aqLLLmKrsjNrUguwk=
golang.org/x/term v0.20.0/go.mod h1:8UkIAJTvZgivsXaD6/pH6U9ecQzZ45awqEOzuCvwpFY=
golang.org/x/term v0.28.0 h1:/Ts8HFuMR2E6IP/jlo7QVLZHggjKQbhu/7H0LJFr3Gg=
golang.org/x/term v0.28.0/go.mod h1:Sw/lC2IAUZ92udQNf3WodGtn4k/XoLyZoh8v/8uiwek=
golang.org/x/term v0.29.0 h1:L6pJp37ocefwRRtYPKSWOWzOtWSxVajvz2ldH/xi3iU=
golang.org/x/term v0.29.0/go.mod h1:6bl4lRlvVuDgSf3179VpIxBF0o10JUpXWOnI7nErv7s=
golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
golang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk=
golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ=
Expand All @@ -592,8 +594,9 @@ golang.org/x/text v0.9.0/go.mod h1:e1OnstbJyHTd6l/uOt8jFFHp6TRDWZR/bV3emEE/zU8=
golang.org/x/text v0.13.0/go.mod h1:TvPlkZtksWOMsz7fbANvkp4WM8x/WCo/om8BMLbz+aE=
golang.org/x/text v0.14.0/go.mod h1:18ZOQIKpY8NJVqYksKHtTdi31H5itFRjB5/qKTNYzSU=
golang.org/x/text v0.15.0/go.mod h1:18ZOQIKpY8NJVqYksKHtTdi31H5itFRjB5/qKTNYzSU=
golang.org/x/text v0.21.0 h1:zyQAAkrwaneQ066sspRyJaG9VNi/YJ1NfzcGB3hZ/qo=
golang.org/x/text v0.21.0/go.mod h1:4IBbMaMmOPCJ8SecivzSH54+73PCFmPWxNTLm+vZkEQ=
golang.org/x/text v0.22.0 h1:bofq7m3/HAFvbF51jz3Q9wLg3jkvSPuiZu/pD1XwgtM=
golang.org/x/text v0.22.0/go.mod h1:YRoo4H8PVmsu+E3Ou7cqLVH8oXWIHVoX0jqUWALQhfY=
golang.org/x/time v0.8.0 h1:9i3RxcPv3PZnitoVGMPDKZSq1xW1gK1Xy3ArNOGZfEg=
golang.org/x/time v0.8.0/go.mod h1:3BpzKBy/shNhVucY/MWOyx10tF3SFh9QdLuxbVysPQM=
golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ=
Expand Down
8 changes: 4 additions & 4 deletions internal/cmd/alpha/module/list.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@ func newListCMD(kymaConfig *cmdcommon.KymaConfig) *cobra.Command {

cmd := &cobra.Command{
Use: "list",
Short: "List modules.",
Long: `List either installed, managed or available Kyma modules.`,
Short: "List installed modules.",
Long: `List installed Kyma modules.`,
Run: func(_ *cobra.Command, _ []string) {
clierror.Check(listModules(&cfg))
},
Expand All @@ -34,9 +34,9 @@ func listModules(cfg *modulesConfig) clierror.Error {
return clierr
}

modulesList, err := modules.List(cfg.Ctx, client)
modulesList, err := modules.ListInstalled(cfg.Ctx, client)
if err != nil {
return clierror.Wrap(err, clierror.New("failed to list available modules from the cluster"))
return clierror.Wrap(err, clierror.New("failed to list installed modules from the cluster"))
}

modules.Render(modulesList, modules.ModulesTableInfo)
Expand Down
31 changes: 31 additions & 0 deletions internal/cmd/alpha/templates/args.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
package templates

import (
"fmt"

"github.com/kyma-project/cli.v3/internal/cmd/alpha/templates/parameters"
"github.com/spf13/cobra"
)

func AssignOptionalNameArg(name *string) func(*cobra.Command, []string) error {
return func(_ *cobra.Command, args []string) error {
if len(args) > 1 {
return fmt.Errorf("accepts at most one resource name as argument, received %d", len(args))
}
if len(args) == 1 {
*name = args[0]
}

return nil
}
}

func AssignRequiredNameArg(name parameters.Value) func(*cobra.Command, []string) error {
return func(_ *cobra.Command, args []string) error {
if len(args) != 1 {
return fmt.Errorf("requires exactly one resource name as an argument, received %d", len(args))
}

return name.Set(args[0])
}
}
51 changes: 46 additions & 5 deletions internal/cmd/alpha/templates/create.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import (
"fmt"
"io"
"os"
"strings"

"github.com/kyma-project/cli.v3/internal/clierror"
"github.com/kyma-project/cli.v3/internal/cmd/alpha/templates/parameters"
Expand All @@ -22,6 +23,7 @@ type KubeClientGetter interface {
type CreateOptions struct {
types.CreateCommand
ResourceInfo types.ResourceInfo
RootCommand types.RootCommand
}

func BuildCreateCommand(clientGetter KubeClientGetter, options *CreateOptions) *cobra.Command {
Expand All @@ -31,9 +33,10 @@ func BuildCreateCommand(clientGetter KubeClientGetter, options *CreateOptions) *
func buildCreateCommand(out io.Writer, clientGetter KubeClientGetter, options *CreateOptions) *cobra.Command {
extraValues := []parameters.Value{}
cmd := &cobra.Command{
Use: "create",
Short: options.Description,
Long: options.DescriptionLong,
Use: "create",
Short: options.Description,
Long: options.DescriptionLong,
Example: buildCreateExample(options),
Run: func(cmd *cobra.Command, args []string) {
clierror.Check(createResource(&createArgs{
out: out,
Expand All @@ -45,8 +48,19 @@ func buildCreateCommand(out io.Writer, clientGetter KubeClientGetter, options *C
},
}

flags := append(options.CustomFlags, commonResourceFlags(options.ResourceInfo.Scope)...)
for _, flag := range flags {
// define resource name as required args[0]
nameArgValue := parameters.NewTyped(resourceNameFlag.Type, resourceNameFlag.Path, resourceNameFlag.DefaultValue)
cmd.Args = AssignRequiredNameArg(nameArgValue)
extraValues = append(extraValues, nameArgValue)

// define --namespace/-n flag only is resource is namespace scoped
if options.ResourceInfo.Scope == types.NamespaceScope {
namespaceFlagValue := parameters.NewTyped(resourceNamespaceFlag.Type, resourceNamespaceFlag.Path, resourceNamespaceFlag.DefaultValue)
cmd.Flags().VarP(namespaceFlagValue, resourceNamespaceFlag.Name, resourceNamespaceFlag.Shorthand, resourceNamespaceFlag.Description)
extraValues = append(extraValues, namespaceFlagValue)
}

for _, flag := range options.CustomFlags {
value := parameters.NewTyped(flag.Type, flag.Path, flag.DefaultValue)
cmd.Flags().VarP(value, flag.Name, flag.Shorthand, flag.Description)
if flag.Required {
Expand All @@ -58,6 +72,33 @@ func buildCreateCommand(out io.Writer, clientGetter KubeClientGetter, options *C
return cmd
}

func buildCreateExample(options *CreateOptions) string {
requiredFlagsExample := strings.Join(buildRequiredFlagsExamples(options), " ")
template := " # create ROOT_COMMAND resource\n" +
" kyma alpha ROOT_COMMAND create <resource_name> " + requiredFlagsExample

if options.ResourceInfo.Scope == types.NamespaceScope {
template += "\n\n" +
" # create ROOT_COMMAND resource in specific namespace\n" +
" kyma alpha ROOT_COMMAND create <resource_name> --namespace <resource_namespace> " + requiredFlagsExample
}

return strings.ReplaceAll(template, "ROOT_COMMAND", options.RootCommand.Name)
}

func buildRequiredFlagsExamples(options *CreateOptions) []string {
requiredFlagsExamples := []string{}
for _, flag := range options.CustomFlags {
if flag.Required {
requiredFlagsExamples = append(requiredFlagsExamples,
fmt.Sprintf("--%s <value>", flag.Name),
)
}
}

return requiredFlagsExamples
}

type createArgs struct {
out io.Writer
ctx context.Context
Expand Down
4 changes: 2 additions & 2 deletions internal/cmd/alpha/templates/create_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ func Test_create(t *testing.T) {
require.Equal(t, "create test deploy", cmd.Short)
require.Equal(t, "use this to create test deploy", cmd.Long)

require.NotNil(t, cmd.Flag("name"))
require.NoError(t, cmd.ValidateArgs([]string{"resource_name"}))
require.NotNil(t, cmd.Flag("namespace"))
require.NotNil(t, cmd.Flag("replicas"))

Expand All @@ -41,7 +41,7 @@ func Test_create(t *testing.T) {
}
cmd := fixCreateCommand(buf, &mock)

cmd.SetArgs([]string{"--name", "test-deploy", "--namespace", "test-namespace", "--replicas", "2"})
cmd.SetArgs([]string{"test-deploy", "--namespace", "test-namespace", "--replicas", "2"})
err := cmd.Execute()
require.NoError(t, err)

Expand Down
39 changes: 29 additions & 10 deletions internal/cmd/alpha/templates/delete.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import (
"fmt"
"io"
"os"
"strings"

"github.com/kyma-project/cli.v3/internal/clierror"
"github.com/kyma-project/cli.v3/internal/cmd/alpha/templates/parameters"
Expand All @@ -17,6 +18,7 @@ import (
type DeleteOptions struct {
types.DeleteCommand
ResourceInfo types.ResourceInfo
RootCommand types.RootCommand
}

func BuildDeleteCommand(clientGetter KubeClientGetter, options *DeleteOptions) *cobra.Command {
Expand All @@ -26,9 +28,10 @@ func BuildDeleteCommand(clientGetter KubeClientGetter, options *DeleteOptions) *
func buildDeleteCommand(out io.Writer, clientGetter KubeClientGetter, options *DeleteOptions) *cobra.Command {
extraValues := []parameters.Value{}
cmd := &cobra.Command{
Use: "delete",
Short: options.Description,
Long: options.DescriptionLong,
Use: "delete",
Short: options.Description,
Long: options.DescriptionLong,
Example: buildDeleteExample(options),
Run: func(cmd *cobra.Command, args []string) {
clierror.Check(deleteResource(&deleteArgs{
out: out,
Expand All @@ -40,18 +43,34 @@ func buildDeleteCommand(out io.Writer, clientGetter KubeClientGetter, options *D
},
}

for _, flag := range commonResourceFlags(options.ResourceInfo.Scope) {
value := parameters.NewTyped(flag.Type, flag.Path, flag.DefaultValue)
cmd.Flags().VarP(value, flag.Name, flag.Shorthand, flag.Description)
if flag.Required {
_ = cmd.MarkFlagRequired(flag.Name)
}
extraValues = append(extraValues, value)
// define resource name as required args[0]
nameArgValue := parameters.NewTyped(resourceNameFlag.Type, resourceNameFlag.Path, resourceNameFlag.DefaultValue)
cmd.Args = AssignRequiredNameArg(nameArgValue)
extraValues = append(extraValues, nameArgValue)

// define --namespace/-n flag only is resource is namespace scoped
if options.ResourceInfo.Scope == types.NamespaceScope {
namespaceFlagValue := parameters.NewTyped(resourceNamespaceFlag.Type, resourceNamespaceFlag.Path, resourceNamespaceFlag.DefaultValue)
cmd.Flags().VarP(namespaceFlagValue, resourceNamespaceFlag.Name, resourceNamespaceFlag.Shorthand, resourceNamespaceFlag.Description)
extraValues = append(extraValues, namespaceFlagValue)
}

return cmd
}

func buildDeleteExample(options *DeleteOptions) string {
template := " # delete resource\n" +
" kyma alpha ROOT_COMMAND delete <resource_name>"

if options.ResourceInfo.Scope == types.NamespaceScope {
template += "\n\n" +
" # delete resource from specific namespace\n" +
" kyma alpha ROOT_COMMAND delete <resource_name> --namespace <resource_namespace> "
}

return strings.ReplaceAll(template, "ROOT_COMMAND", options.RootCommand.Name)
}

type deleteArgs struct {
out io.Writer
ctx context.Context
Expand Down
4 changes: 2 additions & 2 deletions internal/cmd/alpha/templates/delete_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ func Test_remove(t *testing.T) {
require.Equal(t, "delete test deploy", cmd.Short)
require.Equal(t, "use this to delete test deploy", cmd.Long)

require.NotNil(t, cmd.Flag("name"))
require.NoError(t, cmd.ValidateArgs([]string{"resource_name"}))
require.NotNil(t, cmd.Flag("namespace"))
})

Expand All @@ -38,7 +38,7 @@ func Test_remove(t *testing.T) {

cmd := fixDeleteCommand(buf, &mock)

cmd.SetArgs([]string{"--name", "test-deploy", "--namespace", "test-namespace"})
cmd.SetArgs([]string{"test-deploy", "--namespace", "test-namespace"})

err := cmd.Execute()
require.NoError(t, err)
Expand Down
Loading

0 comments on commit c80c47d

Please sign in to comment.