Skip to content

Commit

Permalink
feat(must gather): fix auth error handling
Browse files Browse the repository at this point in the history
  • Loading branch information
lburgazzoli committed Aug 23, 2022
1 parent 81e9300 commit 6776f19
Showing 1 changed file with 8 additions and 5 deletions.
13 changes: 8 additions & 5 deletions rhoc/pkg/util/kubernetes/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -91,12 +91,15 @@ func (in *Client) List(resources []schema.GroupVersionResource, options metav1.L

resList, err := dc.Resource(gvr).List(in.ctx, options)

if err != nil && kerr.IsUnauthorized(err) {
continue
}

if err != nil {
return nil, err
switch {
case kerr.IsUnauthorized(err):
continue
case kerr.IsForbidden(err):
continue
default:
return nil, err
}
}

for i := range resList.Items {
Expand Down

0 comments on commit 6776f19

Please sign in to comment.