Skip to content

Commit

Permalink
Better messaging when support bundle is uploaded
Browse files Browse the repository at this point in the history
  • Loading branch information
divolgin committed Oct 15, 2019
1 parent e88e3a4 commit 642c1d7
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion cmd/troubleshoot/cli/run_nocrd.go
Original file line number Diff line number Diff line change
Expand Up @@ -115,19 +115,27 @@ the %s Admin Console to begin analysis.`
return nil
}

fileUploaded := false
for _, ac := range collector.Spec.AfterCollection {
if ac.UploadResultsTo != nil {
if err := uploadSupportBundle(ac.UploadResultsTo, archivePath); err != nil {
return errors.Wrap(err, "upload support bundle")
}
fileUploaded = true
} else if ac.Callback != nil {
if err := callbackSupportBundleAPI(ac.Callback, archivePath); err != nil {
return errors.Wrap(err, "execute callback")
}
}
}

fmt.Printf("\nA support bundle has been created in the current directory named %q\n", archivePath)
fmt.Printf("\r%s\r", cursor.ClearEntireLine())
if fileUploaded {
fmt.Printf("A support bundle has been created and uploaded to your cluster for analysis. Please visit the Troubleshoot page to continue.\n")
fmt.Printf("A copy of this support bundle was written to the current directory, named %q\n", archivePath)
} else {
fmt.Printf("A support bundle has been created in the current directory named %q\n", archivePath)
}
return nil
}

Expand Down

0 comments on commit 642c1d7

Please sign in to comment.