Skip to content

Commit

Permalink
[CS-14] merging UI update into rc (#18)
Browse files Browse the repository at this point in the history
* update node

* UI tweaks

* fixing a comment

* versionbump

* fixing build errors
  • Loading branch information
decarboxy authored Mar 20, 2019
1 parent b9715f2 commit b0ab4ae
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 1 deletion.
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
2.4.0
2.5.0
6 changes: 6 additions & 0 deletions cmd/argo/commands/common.go
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,12 @@ const (
FgDefault = 39
)

//useful icons
var (
YellowWarning = ansiFormat("⚠", FgYellow)
RedError = ansiFormat("✖", FgRed)
)

func initializeSession() {
jobStatusIconMap = map[wfv1.NodePhase]string{
wfv1.NodePending: ansiFormat("◷", FgYellow),
Expand Down
22 changes: 22 additions & 0 deletions cmd/argo/commands/get.go
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,28 @@ func printWorkflowHelper(wf *wfv1.Workflow, outFmt string) {
}
}
}

errorWriter := tabwriter.NewWriter(os.Stdout, 0, 0, 2, ' ', 0)

if wf.Status.Errors != nil || wf.Status.Warnings != nil {

fmt.Printf("\nErrors and Warnings:\n")
fmt.Fprintf(errorWriter, "%s\tPODNAME\tCODE\tMESSAGE\n", ansiFormat("STEP", FgDefault))
}

if wf.Status.Errors != nil {
for _, errorResult := range wf.Status.Errors {
fmt.Fprintf(errorWriter, "%s %s\t%s\t%s\t%s\n", RedError, errorResult.StepName, errorResult.PodName, errorResult.Name, errorResult.Message)
}
}

if wf.Status.Warnings != nil {
for _, warningResult := range wf.Status.Warnings {
fmt.Fprintf(errorWriter, "%s %s\t%s\t%s\t%s\n", YellowWarning, warningResult.StepName, warningResult.PodName, warningResult.Name, warningResult.Message)
}
}
_ = errorWriter.Flush()

printTree := true
if wf.Status.Nodes == nil {
printTree = false
Expand Down

0 comments on commit b0ab4ae

Please sign in to comment.