Skip to content

Commit a8bdda4

Browse files
authored
Merge pull request #62 from replicatedhq/divolgin/run
run collector times out
2 parents 0c7c8c3 + c3e2748 commit a8bdda4

File tree

2 files changed

+7
-5
lines changed

2 files changed

+7
-5
lines changed

cmd/troubleshoot/cli/run_nocrd.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -74,12 +74,12 @@ func runTroubleshootNoCRD(v *viper.Viper, arg string) error {
7474
switch msg := msg.(type) {
7575
case error:
7676
c := color.New(color.FgHiRed)
77-
c.Println(fmt.Sprintf("%s * %v", cursor.ClearEntireLine(), msg))
77+
c.Println(fmt.Sprintf("%s\r * %v", cursor.ClearEntireLine(), msg))
7878
case string:
7979
currentDir = filepath.Base(msg)
8080
}
8181
case <-finishedCh:
82-
fmt.Printf("\r")
82+
fmt.Printf("\r%s\r", cursor.ClearEntireLine())
8383
return
8484
case <-time.After(time.Millisecond * 100):
8585
if currentDir == "" {
@@ -99,7 +99,7 @@ func runTroubleshootNoCRD(v *viper.Viper, arg string) error {
9999
return errors.Wrap(err, "run collectors")
100100
}
101101

102-
fmt.Printf("\r%s", cursor.ClearEntireLine())
102+
fmt.Printf("\r%s\r", cursor.ClearEntireLine())
103103

104104
if len(collector.Spec.AfterCollection) == 0 {
105105
msg := archivePath
@@ -127,7 +127,7 @@ the %s Admin Console to begin analysis.`
127127
}
128128
}
129129

130-
fmt.Printf("A support bundle has been created in the current directory named %q\n", archivePath)
130+
fmt.Printf("\nA support bundle has been created in the current directory named %q\n", archivePath)
131131
return nil
132132
}
133133

pkg/collect/run.go

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,9 @@ func runWithoutTimeout(ctx *Context, pod *corev1.Pod, runCollector *troubleshoot
7474
if err != nil {
7575
return nil, err
7676
}
77-
if status.Status.Phase == "Running" {
77+
if status.Status.Phase == corev1.PodRunning ||
78+
status.Status.Phase == corev1.PodFailed ||
79+
status.Status.Phase == corev1.PodSucceeded {
7880
break
7981
}
8082
time.Sleep(time.Second * 1)

0 commit comments

Comments
 (0)