-
Notifications
You must be signed in to change notification settings - Fork 251
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Show Sidecar Names with tkn tr desc #747
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -25,3 +25,7 @@ No params | |
Steps | ||
|
||
No steps | ||
|
||
Sidecars | ||
|
||
No sidecars |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -22,3 +22,7 @@ No params | |
Steps | ||
|
||
No steps | ||
|
||
Sidecars | ||
|
||
No sidecars |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -26,3 +26,7 @@ No params | |
Steps | ||
|
||
No steps | ||
|
||
Sidecars | ||
|
||
No sidecars |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -30,3 +30,7 @@ Steps | |
NAME STATUS | ||
step1 Completed | ||
step2 Completed | ||
|
||
Sidecars | ||
|
||
No sidecars |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -25,3 +25,7 @@ No params | |
Steps | ||
|
||
No steps | ||
|
||
Sidecars | ||
|
||
No sidecars |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -30,3 +30,7 @@ Steps | |
NAME STATUS | ||
step1 Completed | ||
step2 Completed | ||
|
||
Sidecars | ||
|
||
No sidecars |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -30,3 +30,7 @@ Steps | |
NAME STATUS | ||
step1 Error | ||
step2 --- | ||
|
||
Sidecars | ||
|
||
No sidecars |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -30,3 +30,8 @@ Steps | |
NAME STATUS | ||
step1 PodInitializing | ||
step2 PodInitializing | ||
|
||
Sidecars | ||
|
||
NAME | ||
sidecar1 |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -30,3 +30,9 @@ Steps | |
NAME STATUS | ||
step1 Running | ||
step2 Running | ||
|
||
Sidecars | ||
|
||
NAME | ||
sidecar1 | ||
sidecar2 |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -64,6 +64,8 @@ func DecorateAttr(attrString, message string) string { | |
return fmt.Sprintf("💌 ") | ||
case "taskruns": | ||
return fmt.Sprintf("🗂 ") | ||
case "sidecars": | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It's gotta be a car, right? 🤷♂ There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Hahah it has to ! 🚗 🚗 🚗 There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. or mothercycle :D but the tiny red car is cutter imho!! |
||
return fmt.Sprintf("🚗 ") | ||
} | ||
|
||
attr := color.Reset | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -80,13 +80,13 @@ func TestDecoration(t *testing.T) { | |
funcMap := template.FuncMap{ | ||
"decorate": DecorateAttr, | ||
} | ||
aTemplate := `{{decorate "bullet" "Foo"}} {{decorate "resources" ""}}{{decorate "params" ""}}{{decorate "tasks" ""}}{{decorate "pipelineruns" ""}}{{decorate "status" ""}}{{decorate "inputresources" ""}}{{decorate "outputresources" ""}}{{decorate "steps" ""}}{{decorate "message" ""}}{{decorate "taskruns" ""}}{{decorate "red" "Red"}} {{decorate "underline" "Foo"}}` | ||
aTemplate := `{{decorate "bullet" "Foo"}} {{decorate "resources" ""}}{{decorate "params" ""}}{{decorate "tasks" ""}}{{decorate "pipelineruns" ""}}{{decorate "status" ""}}{{decorate "inputresources" ""}}{{decorate "outputresources" ""}}{{decorate "steps" ""}}{{decorate "message" ""}}{{decorate "taskruns" ""}}{{decorate "sidecars" ""}}{{decorate "red" "Red"}} {{decorate "underline" "Foo"}}` | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. one day we should clean this up and make the emojis template generation and testing a bit smarter ! |
||
processed := template.Must(template.New("Describe Pipeline").Funcs(funcMap).Parse(aTemplate)) | ||
buf := new(bytes.Buffer) | ||
|
||
if err := processed.Execute(buf, nil); err != nil { | ||
t.Error("Could not process the template.") | ||
} | ||
test.AssertOutput(t, "∙ Foo 📦 ⚓ 🗒 ⛩ 🌡️ 📨 📡 🦶 💌 🗂 \x1b[91mRed\x1b[0m \x1b[4mFoo\x1b[0m", buf.String()) | ||
test.AssertOutput(t, "∙ Foo 📦 ⚓ 🗒 ⛩ 🌡️ 📨 📡 🦶 💌 🗂 🚗 \x1b[91mRed\x1b[0m \x1b[4mFoo\x1b[0m", buf.String()) | ||
|
||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it's merged now, should we wait for a pipeline release to remove this?