From 6eac58d4b03169356d3f06674ef206472e149fde Mon Sep 17 00:00:00 2001 From: Krishna Dutt Panchagnula Date: Thu, 25 May 2023 15:51:06 +0530 Subject: [PATCH] fix: updated list.go to handle k8sgpt cache list crashing issue (#455) * Update list.go Signed-off-by: Krishna Dutt Panchagnula * fix: updated list.go to handle k8sgpt cache list crashing issue Signed-off-by: Krishna Dutt Panchagnula --------- Signed-off-by: Krishna Dutt Panchagnula Co-authored-by: Alex Jones --- cmd/cache/list.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/cmd/cache/list.go b/cmd/cache/list.go index 8fa91fcced..b163532f04 100644 --- a/cmd/cache/list.go +++ b/cmd/cache/list.go @@ -39,8 +39,10 @@ var listCmd = &cobra.Command{ // list the contents of the cache names, err := c.List() if err != nil { - panic(err) + color.Red("Error: %v", err) + os.Exit(1) } + for _, name := range names { println(name) }