Skip to content

Commit bcaaa9e

Browse files
Fix Preflight CheckRBAC (#776)
* return collect result instead of nil
1 parent 2298ec3 commit bcaaa9e

File tree

2 files changed

+9
-3
lines changed

2 files changed

+9
-3
lines changed

pkg/preflight/collect.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -170,7 +170,8 @@ func Collect(opts CollectOpts, p *troubleshootv1beta2.Preflight) (CollectResult,
170170
}
171171

172172
if foundForbidden && !opts.IgnorePermissionErrors {
173-
return nil, errors.New("insufficient permissions to run all collectors")
173+
collectResult.isRBACAllowed = false
174+
return collectResult, errors.New("insufficient permissions to run all collectors")
174175
}
175176

176177
// generate a map of all collectors for atomic status messages

preflight_default.yaml

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,13 @@ metadata:
44
name: modules
55
spec:
66
collectors:
7-
- cpu: {}
8-
# - kernelModules: {}
7+
- logs:
8+
selector:
9+
- app=svclb-traefik
10+
namespace: kube-system
11+
name: backend/container/logs
12+
limits:
13+
maxLines: 1000
914
analyzers:
1015
- clusterVersion:
1116
outcomes:

0 commit comments

Comments
 (0)