Fix Preflight CheckRBAC (#776)

* return collect result instead of nil
This commit is contained in:
Diamon Wiggins
2022-10-13 12:54:40 +13:00
committed by GitHub
parent 2298ec3030
commit bcaaa9e59a
2 changed files with 9 additions and 3 deletions
+2 -1
View File
@@ -170,7 +170,8 @@ func Collect(opts CollectOpts, p *troubleshootv1beta2.Preflight) (CollectResult,
}
if foundForbidden && !opts.IgnorePermissionErrors {
return nil, errors.New("insufficient permissions to run all collectors")
collectResult.isRBACAllowed = false
return collectResult, errors.New("insufficient permissions to run all collectors")
}
// generate a map of all collectors for atomic status messages
+7 -2
View File
@@ -4,8 +4,13 @@ metadata:
name: modules
spec:
collectors:
- cpu: {}
# - kernelModules: {}
- logs:
selector:
- app=svclb-traefik
namespace: kube-system
name: backend/container/logs
limits:
maxLines: 1000
analyzers:
- clusterVersion:
outcomes: