chore: Update CLI prompt to run command as root (#1517)

This commit is contained in:
Evans Mungai
2024-03-28 19:13:33 +00:00
committed by GitHub
parent ca5ff88964
commit c9830de736
3 changed files with 4 additions and 3 deletions

View File

@@ -113,9 +113,8 @@ func runTroubleshoot(v *viper.Viper, args []string) error {
if interactive {
if len(mainBundle.Spec.HostCollectors) > 0 && !util.IsRunningAsRoot() {
msg := "Some host collectors may require elevated privileges to run.\nDo you want to exit and rerun the command as a privileged user?"
fmt.Print(cursor.Show())
if util.PromptYesNo(msg) {
if util.PromptYesNo(util.HOST_COLLECTORS_RUN_AS_ROOT_PROMPT) {
fmt.Println("Exiting...")
return nil
}