troubleshoot
troubleshoot copied to clipboard
Preflight should not fail with RBAC permissions error if the missing collector is not used
If I have a Preflight with no collectors defined, the clusterInfo and clusterResources collectors are automatically added. If the preflight has a distribution or version analyzer defined, this is useful. But it's impossible to remove these default collectors. If I don't have any analyzers that use the output of them, kubectl preflight should not fail because it couldn't collect (and discard) data.
There are a few ways we could solve this problem. But since kots supports conditional analyzers and template functions, I propose that we solve this problem by failing later, rather than early. Collect what's possible to collect, and have the analyzer fail with a message that the data was not available, instead of having the collector fail with a message that the data could not be collected.