Skip to content
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

chore(cli): Migrate argo logs to use API client. See #2116 #2177

Merged
merged 33 commits into from
Feb 25, 2020
Merged
Show file tree
Hide file tree
Changes from 30 commits
Commits
Show all changes
33 commits
Select commit Hold shift + click to select a range
cc26a3b
chore: Migrate `argo logs` to use API client. See #2116
alexec Feb 5, 2020
664e33a
changes
alexec Feb 5, 2020
b52d20a
fix: Correctly create code from changed protos.
alexec Feb 5, 2020
12eb78e
Merge branch 'codegen' into cli-logs
alexec Feb 5, 2020
587e36d
lint
alexec Feb 5, 2020
b4d49dc
Merge branch 'master' into cli-logs
alexec Feb 6, 2020
75504ed
codegen
alexec Feb 6, 2020
a4b92a0
make codegen
alexec Feb 6, 2020
e379903
logs
alexec Feb 6, 2020
2ab5dde
changes
alexec Feb 6, 2020
0d40d96
oddloading
alexec Feb 6, 2020
cab847e
correct diagnostic output
alexec Feb 6, 2020
271eb45
hopefully the final changes
alexec Feb 6, 2020
7ed136f
changes
alexec Feb 6, 2020
7168d34
Merge branch 'master' into cli-logs
alexec Feb 7, 2020
52e85da
Merge branch 'master' into cli-logs
alexec Feb 10, 2020
88fd4ad
feat(cli-logs): fix merge + make lint
alexec Feb 10, 2020
9420827
lint
alexec Feb 10, 2020
b589a73
Merge branch 'master' into cli-logs
alexec Feb 11, 2020
1f416ff
tidy up
alexec Feb 11, 2020
8078538
Merge branch 'master' into cli-logs
alexec Feb 20, 2020
67e4f53
codegen
alexec Feb 20, 2020
1c23aa4
test(cli): fix test
alexec Feb 20, 2020
50d67aa
Merge branch 'master' into cli-logs
alexec Feb 20, 2020
ecaf440
logs
alexec Feb 21, 2020
5fed826
reinstate vendor
alexec Feb 21, 2020
1ed093a
Merge branch 'master' into cli-logs
alexec Feb 22, 2020
78eeb15
changes
alexec Feb 22, 2020
802c290
Merge branch 'master' into cli-logs
alexec Feb 24, 2020
d868351
interm-2
alexec Feb 24, 2020
67c4ff9
copylocks lint
alexec Feb 24, 2020
0594ddd
Merge branch 'master' into cli-logs
alexec Feb 25, 2020
0ec7417
Merge branch 'master' into cli-logs
alexec Feb 25, 2020
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions api/argo-server/swagger.json
Original file line number Diff line number Diff line change
Expand Up @@ -5308,6 +5308,9 @@
"properties": {
"content": {
"type": "string"
},
"podName": {
"type": "string"
}
}
},
Expand Down
9 changes: 9 additions & 0 deletions cmd/argo/commands/common.go
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,15 @@ func InitWorkflowClient(ns ...string) v1alpha1.WorkflowInterface {
return wfClient
}

func ansiColorCode(s string) int {
i := 0
for _, c := range s {
i += int(c)
}
colors := []int{FgRed, FgGreen, FgYellow, FgBlue, FgMagenta, FgCyan, FgWhite}
return colors[i%len(colors)]
}

// ansiFormat wraps ANSI escape codes to a string to format the string to a desired color.
// NOTE: we still apply formatting even if there is no color formatting desired.
// The purpose of doing this is because when we apply ANSI color escape sequences to our
Expand Down
15 changes: 15 additions & 0 deletions cmd/argo/commands/common_test.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
package commands

import (
"testing"

"github.com/stretchr/testify/assert"
)

func Test_ansiFormatCode(t *testing.T) {
// check we get a nice range of colours
assert.Equal(t, FgYellow, ansiColorCode("foo"))
assert.Equal(t, FgGreen, ansiColorCode("bar"))
assert.Equal(t, FgYellow, ansiColorCode("baz"))
assert.Equal(t, FgRed, ansiColorCode("qux"))
}
Loading