Skip to content

Commit

Permalink
Fix panic calling tanzu package installed status (#1161)
Browse files Browse the repository at this point in the history
* Fix panic calling tanzu package installed status

Calling tanzu package installed status without any arguments causes the
program to panic.

Signed-off-by: Borja Clemente <cborja@vmware.com>

* Apply review feedback

Signed-off-by: Borja Clemente <cborja@vmware.com>

---------

Signed-off-by: Borja Clemente <cborja@vmware.com>
  • Loading branch information
clebs authored Apr 5, 2023
1 parent 15c92de commit 9a0282f
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion cli/pkg/kctrl/cmd/package/installed/status.go
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,9 @@ func NewStatusCmd(o *StatusOptions, flagsFactory cmdcore.FlagsFactory) *cobra.Co

func (o *StatusOptions) Run(args []string) error {
if o.pkgCmdTreeOpts.PositionalArgs {
o.Name = args[0]
if len(args) > 0 {
o.Name = args[0]
}
}

if len(o.Name) == 0 {
Expand Down

0 comments on commit 9a0282f

Please sign in to comment.