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
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ require (
github.com/mattn/go-colorable v0.1.7
github.com/mattn/go-isatty v0.0.12
github.com/pkg/errors v0.9.1 // indirect
github.com/scaleway/scaleway-sdk-go v1.0.0-beta.7.0.20210104102201-c1581bd3f961
github.com/scaleway/scaleway-sdk-go v1.0.0-beta.7.0.20210118180419-87b8b277149c
github.com/sergi/go-diff v1.1.0 // indirect
github.com/spf13/cobra v1.0.0
github.com/spf13/pflag v1.0.5
Expand Down
4 changes: 2 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -118,8 +118,8 @@ github.com/prometheus/procfs v0.0.0-20190507164030-5867b95ac084/go.mod h1:TjEm7z
github.com/prometheus/tsdb v0.7.1/go.mod h1:qhTCs0VvXwvX/y3TZrWD7rabWM+ijKTux40TwIPHuXU=
github.com/rogpeppe/fastuuid v0.0.0-20150106093220-6724a57986af/go.mod h1:XWv6SoW27p1b0cqNHllgS5HIMJraePCO15w5zCzIWYg=
github.com/russross/blackfriday/v2 v2.0.1/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM=
github.com/scaleway/scaleway-sdk-go v1.0.0-beta.7.0.20210104102201-c1581bd3f961 h1:77+4aSKjBGBmgifdCZ1YSGPDwAcgJNTqbiJKqORl36E=
github.com/scaleway/scaleway-sdk-go v1.0.0-beta.7.0.20210104102201-c1581bd3f961/go.mod h1:CJJ5VAbozOl0yEw7nHB9+7BXTJbIn6h7W+f6Gau5IP8=
github.com/scaleway/scaleway-sdk-go v1.0.0-beta.7.0.20210118180419-87b8b277149c h1:NDAovDzT4JfgX7k/ED0Y5/swOtsIsDCRQMzzqPh3yA0=
github.com/scaleway/scaleway-sdk-go v1.0.0-beta.7.0.20210118180419-87b8b277149c/go.mod h1:CJJ5VAbozOl0yEw7nHB9+7BXTJbIn6h7W+f6Gau5IP8=
github.com/sergi/go-diff v1.1.0 h1:we8PVUC3FE2uYfodKH/nBHMSetSfHDR6scGdBi+erh0=
github.com/sergi/go-diff v1.1.0/go.mod h1:STckp+ISIX8hZLjrqAeVduY0gWCT9IjLuqbuNXdaHfM=
github.com/shurcooL/sanitized_anchor_name v1.0.0/go.mod h1:1NzhyTcUVG4SuEtjjoZeVRXNmyL/1OwPU0+IJeTBvfc=
Expand Down
4 changes: 1 addition & 3 deletions internal/e2e/testdata/test-human-create-simple.golden
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ EyesColor unknown
Status stopped
Name -
ProjectID 11111111-1111-1111-1111-111111111111
Region fr-par
🟩🟩🟩 JSON STDOUT 🟩🟩🟩
{
"id": "0194fdc2-fa2f-fcc0-41d3-ff12045b73c8",
Expand All @@ -32,6 +31,5 @@ Region fr-par
"eyes_color": "unknown",
"status": "stopped",
"name": "",
"project_id": "11111111-1111-1111-1111-111111111111",
"region": "fr-par"
"project_id": "11111111-1111-1111-1111-111111111111"
}
1 change: 0 additions & 1 deletion internal/e2e/testdata/test-human-create-usage.golden
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ ARGS:
[name]
[project-id] Project ID to use. If none is passed the default project ID will be used
[organization-id] Organization ID to use. If none is passed the default organization ID will be used
[region=fr-par] Region to target. If none is passed will use default region from the config (fr-par)

FLAGS:
-h, --help help for create
Expand Down
4 changes: 1 addition & 3 deletions internal/e2e/testdata/test-human-create-with-args.golden
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ EyesColor amber
Status stopped
Name -
ProjectID b3ba839a-dcf2-4b0a-ac81-fc32370052a0
Region fr-par
🟩🟩🟩 JSON STDOUT 🟩🟩🟩
{
"id": "0194fdc2-fa2f-fcc0-41d3-ff12045b73c8",
Expand All @@ -32,6 +31,5 @@ Region fr-par
"eyes_color": "amber",
"status": "stopped",
"name": "",
"project_id": "b3ba839a-dcf2-4b0a-ac81-fc32370052a0",
"region": "fr-par"
"project_id": "b3ba839a-dcf2-4b0a-ac81-fc32370052a0"
}
4 changes: 1 addition & 3 deletions internal/e2e/testdata/test-human-delete-simple.golden
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ EyesColor blue
Status stopped
Name -
ProjectID b3ba839a-dcf2-4b0a-ac81-fc32370052a0
Region fr-par
🟩🟩🟩 JSON STDOUT 🟩🟩🟩
{
"id": "0194fdc2-fa2f-fcc0-41d3-ff12045b73c8",
Expand All @@ -32,6 +31,5 @@ Region fr-par
"eyes_color": "blue",
"status": "stopped",
"name": "",
"project_id": "b3ba839a-dcf2-4b0a-ac81-fc32370052a0",
"region": "fr-par"
"project_id": "b3ba839a-dcf2-4b0a-ac81-fc32370052a0"
}
3 changes: 1 addition & 2 deletions internal/e2e/testdata/test-human-delete-usage.golden
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,7 @@ USAGE:
scw test human delete <human-id ...> [arg=value ...]

ARGS:
human-id UUID of the human you want to delete
[region=fr-par] Region to target. If none is passed will use default region from the config (fr-par)
human-id UUID of the human you want to delete

FLAGS:
-h, --help help for delete
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@
Unknown argument 'invalid'

Hint:
Valid arguments are: human-id, region
Valid arguments are: human-id
🟥🟥🟥 JSON STDERR 🟥🟥🟥
{
"message": "unknown argument 'invalid'",
"error": {},
"hint": "Valid arguments are: human-id, region"
"hint": "Valid arguments are: human-id"
}
4 changes: 1 addition & 3 deletions internal/e2e/testdata/test-human-get-simple.golden
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ EyesColor blue
Status stopped
Name -
ProjectID b3ba839a-dcf2-4b0a-ac81-fc32370052a0
Region fr-par
🟩🟩🟩 JSON STDOUT 🟩🟩🟩
{
"id": "0194fdc2-fa2f-fcc0-41d3-ff12045b73c8",
Expand All @@ -32,6 +31,5 @@ Region fr-par
"eyes_color": "blue",
"status": "stopped",
"name": "",
"project_id": "b3ba839a-dcf2-4b0a-ac81-fc32370052a0",
"region": "fr-par"
"project_id": "b3ba839a-dcf2-4b0a-ac81-fc32370052a0"
}
3 changes: 1 addition & 2 deletions internal/e2e/testdata/test-human-get-usage.golden
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,7 @@ USAGE:
scw test human get <human-id ...> [arg=value ...]

ARGS:
human-id UUID of the human you want to get
[region=fr-par] Region to target. If none is passed will use default region from the config (fr-par)
human-id UUID of the human you want to get

FLAGS:
-h, --help help for get
Expand Down
17 changes: 7 additions & 10 deletions internal/e2e/testdata/test-human-list-simple.golden
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
🎲🎲🎲 EXIT CODE: 0 🎲🎲🎲
🟩🟩🟩 STDOUT️ 🟩🟩🟩️
ID ORGANIZATION ID CREATED AT UPDATED AT HEIGHT SHOE SIZE ALTITUDE IN METER ALTITUDE IN MILLIMETER FINGERS COUNT HAIR COUNT IS HAPPY EYES COLOR STATUS NAME PROJECT ID REGION
0194fdc2-fa2f-fcc0-41d3-ff12045b73c8 11111111-1111-1111-1111-111111111111 few seconds ago few seconds ago 0 0 0 0 0 0 false unknown stopped - 11111111-1111-1111-1111-111111111111 fr-par
62a5eee8-2abd-f44a-2d0b-75fb180daf48 11111111-1111-1111-1111-111111111111 few seconds ago few seconds ago 0 0 0 0 0 0 false unknown stopped - 11111111-1111-1111-1111-111111111111 fr-par
39465185-0fd4-a178-892e-e285ece15114 11111111-1111-1111-1111-111111111111 few seconds ago few seconds ago 0 0 0 0 0 0 false unknown stopped - 11111111-1111-1111-1111-111111111111 fr-par
ID ORGANIZATION ID CREATED AT UPDATED AT HEIGHT SHOE SIZE ALTITUDE IN METER ALTITUDE IN MILLIMETER FINGERS COUNT HAIR COUNT IS HAPPY EYES COLOR STATUS NAME PROJECT ID
0194fdc2-fa2f-fcc0-41d3-ff12045b73c8 11111111-1111-1111-1111-111111111111 few seconds ago few seconds ago 0 0 0 0 0 0 false unknown stopped - 11111111-1111-1111-1111-111111111111
62a5eee8-2abd-f44a-2d0b-75fb180daf48 11111111-1111-1111-1111-111111111111 few seconds ago few seconds ago 0 0 0 0 0 0 false unknown stopped - 11111111-1111-1111-1111-111111111111
39465185-0fd4-a178-892e-e285ece15114 11111111-1111-1111-1111-111111111111 few seconds ago few seconds ago 0 0 0 0 0 0 false unknown stopped - 11111111-1111-1111-1111-111111111111
🟩🟩🟩 JSON STDOUT 🟩🟩🟩
[
{
Expand All @@ -21,8 +21,7 @@ ID ORGANIZATION ID CREA
"eyes_color": "unknown",
"status": "stopped",
"name": "",
"project_id": "11111111-1111-1111-1111-111111111111",
"region": "fr-par"
"project_id": "11111111-1111-1111-1111-111111111111"
},
{
"id": "62a5eee8-2abd-f44a-2d0b-75fb180daf48",
Expand All @@ -39,8 +38,7 @@ ID ORGANIZATION ID CREA
"eyes_color": "unknown",
"status": "stopped",
"name": "",
"project_id": "11111111-1111-1111-1111-111111111111",
"region": "fr-par"
"project_id": "11111111-1111-1111-1111-111111111111"
},
{
"id": "39465185-0fd4-a178-892e-e285ece15114",
Expand All @@ -57,7 +55,6 @@ ID ORGANIZATION ID CREA
"eyes_color": "unknown",
"status": "stopped",
"name": "",
"project_id": "11111111-1111-1111-1111-111111111111",
"region": "fr-par"
"project_id": "11111111-1111-1111-1111-111111111111"
}
]
1 change: 0 additions & 1 deletion internal/e2e/testdata/test-human-list-usage.golden
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ ARGS:
[order-by] (created_at_asc | created_at_desc | updated_at_asc | updated_at_desc | height_asc | height_desc)
[project-id]
[organization-id]
[region=fr-par] Region to target. If none is passed will use default region from the config (fr-par)

FLAGS:
-h, --help help for list
Expand Down
3 changes: 1 addition & 2 deletions internal/e2e/testdata/test-human-run-usage.golden
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,7 @@ EXAMPLES:
scw test human run xxxxx

ARGS:
human-id UUID of the human you want to make run
[region=fr-par] Region to target. If none is passed will use default region from the config (fr-par)
human-id UUID of the human you want to make run

FLAGS:
-h, --help help for run
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ EyesColor blue
Status stopped
Name -
ProjectID 11111111-1111-1111-1111-111111111111
Region fr-par
🟩🟩🟩 JSON STDOUT 🟩🟩🟩
{
"id": "0194fdc2-fa2f-fcc0-41d3-ff12045b73c8",
Expand All @@ -32,6 +31,5 @@ Region fr-par
"eyes_color": "blue",
"status": "stopped",
"name": "",
"project_id": "11111111-1111-1111-1111-111111111111",
"region": "fr-par"
"project_id": "11111111-1111-1111-1111-111111111111"
}
4 changes: 1 addition & 3 deletions internal/e2e/testdata/test-human-update-single-arg.golden
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ EyesColor amber
Status stopped
Name -
ProjectID b3ba839a-dcf2-4b0a-ac81-fc32370052a0
Region fr-par
🟩🟩🟩 JSON STDOUT 🟩🟩🟩
{
"id": "0194fdc2-fa2f-fcc0-41d3-ff12045b73c8",
Expand All @@ -32,6 +31,5 @@ Region fr-par
"eyes_color": "amber",
"status": "stopped",
"name": "",
"project_id": "b3ba839a-dcf2-4b0a-ac81-fc32370052a0",
"region": "fr-par"
"project_id": "b3ba839a-dcf2-4b0a-ac81-fc32370052a0"
}
1 change: 0 additions & 1 deletion internal/e2e/testdata/test-human-update-usage.golden
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ ARGS:
[is-happy]
[eyes-color] (unknown | amber | blue | brown | gray | green | hazel | red | violet)
[name]
[region=fr-par] Region to target. If none is passed will use default region from the config (fr-par)

FLAGS:
-h, --help help for update
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@
A positional argument is required for this command

Hint:
Try running: scw test human get 0194fdc2-fa2f-fcc0-41d3-ff12045b73c8 region=fr-par
Try running: scw test human get 0194fdc2-fa2f-fcc0-41d3-ff12045b73c8
🟥🟥🟥 JSON STDERR 🟥🟥🟥
{
"message": "a positional argument is required for this command",
"error": {},
"hint": "Try running: scw test human get 0194fdc2-fa2f-fcc0-41d3-ff12045b73c8 region=fr-par"
"hint": "Try running: scw test human get 0194fdc2-fa2f-fcc0-41d3-ff12045b73c8"
}
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@
A positional argument is required for this command

Hint:
Try running: scw test human update 0194fdc2-fa2f-fcc0-41d3-ff12045b73c8 eyes-color=red region=fr-par
Try running: scw test human update 0194fdc2-fa2f-fcc0-41d3-ff12045b73c8 eyes-color=red
🟥🟥🟥 JSON STDERR 🟥🟥🟥
{
"message": "a positional argument is required for this command",
"error": {},
"hint": "Try running: scw test human update 0194fdc2-fa2f-fcc0-41d3-ff12045b73c8 eyes-color=red region=fr-par"
"hint": "Try running: scw test human update 0194fdc2-fa2f-fcc0-41d3-ff12045b73c8 eyes-color=red"
}
8 changes: 0 additions & 8 deletions internal/namespaces/test/v1/test_cli.go
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,6 @@ Hint: you can use other test commands by setting the SCW_SECRET_KEY env variable
Deprecated: false,
Positional: false,
},
core.RegionArgSpec(scw.RegionFrPar),
},
Run: func(ctx context.Context, args interface{}) (i interface{}, e error) {
request := args.(*test.RegisterRequest)
Expand Down Expand Up @@ -126,7 +125,6 @@ func testHumanList() *core.Command {
Deprecated: false,
Positional: false,
},
core.RegionArgSpec(scw.RegionFrPar),
},
Run: func(ctx context.Context, args interface{}) (i interface{}, e error) {
request := args.(*test.ListHumansRequest)
Expand Down Expand Up @@ -160,7 +158,6 @@ func testHumanGet() *core.Command {
Deprecated: false,
Positional: true,
},
core.RegionArgSpec(scw.RegionFrPar),
},
Run: func(ctx context.Context, args interface{}) (i interface{}, e error) {
request := args.(*test.GetHumanRequest)
Expand Down Expand Up @@ -240,7 +237,6 @@ func testHumanCreate() *core.Command {
},
core.ProjectIDArgSpec(),
core.OrganizationIDArgSpec(),
core.RegionArgSpec(scw.RegionFrPar),
},
Run: func(ctx context.Context, args interface{}) (i interface{}, e error) {
request := args.(*test.CreateHumanRequest)
Expand Down Expand Up @@ -331,7 +327,6 @@ func testHumanUpdate() *core.Command {
Deprecated: false,
Positional: false,
},
core.RegionArgSpec(scw.RegionFrPar),
},
Run: func(ctx context.Context, args interface{}) (i interface{}, e error) {
request := args.(*test.UpdateHumanRequest)
Expand Down Expand Up @@ -361,7 +356,6 @@ func testHumanDelete() *core.Command {
Deprecated: false,
Positional: true,
},
core.RegionArgSpec(scw.RegionFrPar),
},
Run: func(ctx context.Context, args interface{}) (i interface{}, e error) {
request := args.(*test.DeleteHumanRequest)
Expand Down Expand Up @@ -391,7 +385,6 @@ func testHumanRun() *core.Command {
Deprecated: false,
Positional: true,
},
core.RegionArgSpec(scw.RegionFrPar),
},
Run: func(ctx context.Context, args interface{}) (i interface{}, e error) {
request := args.(*test.RunHumanRequest)
Expand Down Expand Up @@ -428,7 +421,6 @@ func testHumanSmoke() *core.Command {
Deprecated: true,
Positional: true,
},
core.RegionArgSpec(scw.RegionFrPar),
},
Run: func(ctx context.Context, args interface{}) (i interface{}, e error) {
request := args.(*test.SmokeHumanRequest)
Expand Down