Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
11 changes: 6 additions & 5 deletions cmd/kosli/multiHost.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,14 @@ Kosli uses CI pipelines in the cyber-dojo Org repos [*] for two purposes:
1. public facing documentation
2. private development purposes

All Kosli CLI calls in [*] are made to _two_ servers (because of 2)
All Kosli CLI calls in [*] are made to _three_ servers (because of 2)
- https://app.kosli.com
- https://staging.app.kosli.com
- https://app.us.kosli.com

Explicitly making each Kosli CLI call in [*] twice is not an option (because of 1)
Duplicating the entire CI workflows is complex because, eg, deployments must not be duplicated.
The least-worst option is to allow KOSLI_HOST and KOSLI_API_TOKEN to specify two
Explicitly making each Kosli CLI call in [*] three times is not an option (because of 1)
Duplicating the entire CI workflows is complex, eg, deployments must not be duplicated.
The least-worst option is to allow KOSLI_HOST and KOSLI_API_TOKEN to specify multiple
comma-separated values. Note cyber-dojo must ensure its api-tokens do not contain commas.
*/

Expand Down Expand Up @@ -52,7 +53,7 @@ func runMultiHost(args []string) (string, error) {
args0 := argsAppendHostApiTokenFlags(0)
output0, err0 := runBufferedInnerMain(args0)

stdOut := output0
stdOut := fmt.Sprintf("[%s]\n", opts.hosts[0]) + output0
var errorMessage string

if err0 != nil {
Expand Down
4 changes: 2 additions & 2 deletions cmd/kosli/multiHost_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ func (suite *MultiHostTestSuite) TestRunDoubledHost() {
{
name: "only returns primary call output when both (2) calls succeed",
args: doubledArgs([]string{"kosli", "status"}),
stdOut: []string{"OK", ""},
stdOut: []string{"[http://localhost:8001]", "OK", ""},
err: error(nil),
},
} {
Expand Down Expand Up @@ -153,7 +153,7 @@ func (suite *MultiHostTestSuite) TestRunTripledHost() {
{
name: "only returns primary call output when all three calls succeed",
args: tripledArgs([]string{"kosli", "status"}),
stdOut: []string{"OK", ""},
stdOut: []string{"[http://localhost:8001]", "OK", ""},
err: error(nil),
},
} {
Expand Down