carvel-dev / kapp

kapp is a simple deployment tool focused on the concept of "Kubernetes application" — a set of resources with the same label
https://carvel.dev/kapp
Apache License 2.0
881 stars 108 forks source link

Specifying an invalid value for `columns` results in a stack trace #741

Open jtigger opened 1 year ago

jtigger commented 1 year ago

What steps did you take:

kapp ls -A --column id

What happened:

...
panic: Failed to find header: id

goroutine 1 [running]:
github.com/cppforlife/go-cli-ui/ui.(*ConfUI).PrintTable(0x140000f2700, {{0x10329afa1, 0x16}, {0x103287e7c, 0x4}, {0x140001e6000, 0x6, 0x6}, {0x14000709ae0, 0x2, ...}, ...})
    github.com/cppforlife/go-cli-ui@v0.0.0-20200716203538-1e47f820817f/ui/conf_ui.go:85 +0x88
github.com/vmware-tanzu/carvel-kapp/pkg/kapp/cmd/app.(*ListOptions).Run(0x140000e3200)
    github.com/vmware-tanzu/carvel-kapp/pkg/kapp/cmd/app/list.go:156 +0x740
github.com/vmware-tanzu/carvel-kapp/pkg/kapp/cmd/app.NewListCmd.func1(0x42bd590?, {0x140007a0540?, 0x14000859260?, 0x14000811a80?})
    github.com/vmware-tanzu/carvel-kapp/pkg/kapp/cmd/app/list.go:37 +0x20
github.com/cppforlife/cobrautil.WrapRunEForCmd.func1.1(0x140000f6cf0?, {0x140007a0540, 0x0, 0x3})
    github.com/cppforlife/cobrautil@v0.0.0-20220907150944-da5ee3a6ab1f/misc.go:45 +0x68
github.com/vmware-tanzu/carvel-kapp/pkg/kapp/cmd.NewKappCmd.func1.1(0x140001a3c48?, {0x140007a0540, 0x0, 0x3})
    github.com/vmware-tanzu/carvel-kapp/pkg/kapp/cmd/kapp.go:128 +0xa8
github.com/cppforlife/cobrautil.WrapRunEForCmd.func1.1(0x140000a9c00?, {0x140007a0540, 0x0, 0x3})
    github.com/cppforlife/cobrautil@v0.0.0-20220907150944-da5ee3a6ab1f/misc.go:45 +0x68
github.com/cppforlife/cobrautil.WrapRunEForCmd.func1.1(0x140000a9c00?, {0x140007a0540, 0x0, 0x3})
    github.com/cppforlife/cobrautil@v0.0.0-20220907150944-da5ee3a6ab1f/misc.go:45 +0x68
github.com/cppforlife/cobrautil.WrapRunEForCmd.func1.1(0x1400042b400?, {0x140007a0540, 0x0, 0x3})
    github.com/cppforlife/cobrautil@v0.0.0-20220907150944-da5ee3a6ab1f/misc.go:45 +0x68
github.com/spf13/cobra.(*Command).execute(0x1400042b400, {0x140007a0510, 0x3, 0x3})
    github.com/spf13/cobra@v1.4.0/command.go:856 +0x4c4
github.com/spf13/cobra.(*Command).ExecuteC(0x1400042af00)
    github.com/spf13/cobra@v1.4.0/command.go:974 +0x354
github.com/spf13/cobra.(*Command).Execute(...)
    github.com/spf13/cobra@v1.4.0/command.go:902
main.nonExitingMain()
    github.com/vmware-tanzu/carvel-kapp/cmd/kapp/kapp.go:43 +0x110
main.main()
    github.com/vmware-tanzu/carvel-kapp/cmd/kapp/kapp.go:22 +0x1c

What did you expect: An error message indicating that "id" is not a valid column. Ideally, would list the acceptable/valid values.

Anything else you would like to add:

Environment:


Vote on this request

This is an invitation to the community to vote on issues, to help us prioritize our backlog. Use the "smiley face" up to the right of this comment to vote.

👍 "I would like to see this addressed as soon as possible" 👎 "There are other more important things to focus on right now"

We are also happy to receive and review Pull Requests if you want to help working on this issue.

github-actions[bot] commented 1 year ago

This issue is being marked as stale due to a long period of inactivity and will be closed in 5 days if there is no response.

praveenrewar commented 1 year ago

This would require making some changes in the underlying ui library.