From 23c9dbe48d0b9b03cc205d31a982efb134bcd194 Mon Sep 17 00:00:00 2001 From: Justin Toh Date: Fri, 4 Mar 2022 00:29:12 +0800 Subject: [PATCH] fix: Fix helm subcommand crashes when client does not have permission to list Secrets Signed-off-by: Justin Toh --- pkg/cmd/helm/helm.go | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/pkg/cmd/helm/helm.go b/pkg/cmd/helm/helm.go index 9f1ab1f..1756b81 100644 --- a/pkg/cmd/helm/helm.go +++ b/pkg/cmd/helm/helm.go @@ -235,9 +235,13 @@ func (o *CmdOptions) Run() error { return err } - // Include release objects into objects to handle cases where user has access - // to get the release objects but unable to list its resource type + // Include release & secret objects into objects to handle cases where user + // has access to get them individually but unable to list their respective + // resource types objs.Items = append(objs.Items, rlsObjs...) + if stgObj != nil { + objs.Items = append(objs.Items, *stgObj) + } // Collect UIDs from release & storage objects var uids []types.UID