If host collectors are present in a spec when running support-bundle or preflight CLIs, we want to prompt a user to run the binary as an elevated user. This is because some of the tools executed require elevated privileges. Without elevated privileges, the collected data ends up being useless.
Prompt to run as root
support-bundle https://raw.githubusercontent.com/replicatedhq/troubleshoot-specs/main/host/default.yaml
Some host collectors may require elevated privileges to run.
Do you want to exit and rerun the command as a privileged user? (yes/no): yes
Exiting...
When the user declines (no), the process continues as normal
Additional context
We collectively check the presence/absence of host collectors because we cannot confidently tell which collectors require elevated privileges or don't. Both run and copy collectors for example can wrap any command/path that requires root access. Our default host collector spec uses these collectors extensively.
Checklist
[ ] New and existing tests pass locally with introduced changes.
[x] Tests for the changes have been added (for bug fixes / features)
[x] The commit message(s) are informative and highlight any breaking changes
Description, Motivation and Context
If host collectors are present in a spec when running
support-bundle
orpreflight
CLIs, we want to prompt a user to run the binary as an elevated user. This is because some of the tools executed require elevated privileges. Without elevated privileges, the collected data ends up being useless.Prompt to run as root
When the user declines (no), the process continues as normal
Additional context
We collectively check the presence/absence of host collectors because we cannot confidently tell which collectors require elevated privileges or don't. Both run and copy collectors for example can wrap any command/path that requires root access. Our default host collector spec uses these collectors extensively.
Checklist
Does this PR introduce a breaking change?