Skip to content

Commit 810b3cb

Browse files
author
Salah Aldeen Al Saleh
authored
support non-interactive mode in support bundle (#340)
* support non-interactive mode in support bundle
1 parent 8178918 commit 810b3cb

File tree

2 files changed

+2
-1
lines changed

2 files changed

+2
-1
lines changed

cmd/troubleshoot/cli/root.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@ from a server that can be used to assist when troubleshooting a Kubernetes clust
3838

3939
cmd.Flags().StringSlice("redactors", []string{}, "names of the additional redactors to use")
4040
cmd.Flags().Bool("redact", true, "enable/disable default redactions")
41+
cmd.Flags().Bool("interactive", true, "enable/disable interactive mode")
4142
cmd.Flags().Bool("collect-without-permissions", false, "always generate a support bundle, even if it some require additional permissions")
4243
cmd.Flags().String("since-time", "", "force pod logs collectors to return logs after a specific date (RFC3339)")
4344
cmd.Flags().String("since", "", "force pod logs collectors to return logs newer than a relative duration like 5s, 2m, or 3h.")

cmd/troubleshoot/cli/run.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -200,7 +200,7 @@ func runTroubleshoot(v *viper.Viper, arg string) error {
200200
c.Printf("%s\r * Failed to analyze support bundle: %v\n", cursor.ClearEntireLine(), err)
201201
}
202202

203-
interactive := isatty.IsTerminal(os.Stdout.Fd())
203+
interactive := v.GetBool("interactive") && isatty.IsTerminal(os.Stdout.Fd())
204204

205205
if interactive {
206206
close(finishedCh) // this removes the spinner

0 commit comments

Comments
 (0)