Skip to content

Commit 4bbcb35

Browse files
authored
runner: Populate Region field API calls (#308)
Populates the new Region field on all of the runnerapi calls.
1 parent 1088cdf commit 4bbcb35

File tree

6 files changed

+18
-19
lines changed

6 files changed

+18
-19
lines changed

cmd/platform/runner/list.go

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,10 @@ var listCmd = &cobra.Command{
2929
Short: "Lists the existing platform runners",
3030
PreRunE: cobra.NoArgs,
3131
RunE: func(cmd *cobra.Command, args []string) error {
32-
res, err := runnerapi.List(runnerapi.Params{API: ecctl.Get().API})
32+
res, err := runnerapi.List(runnerapi.ListParams{
33+
API: ecctl.Get().API,
34+
Region: ecctl.Get().Config.Region,
35+
})
3336
if err != nil {
3437
return err
3538
}

cmd/platform/runner/resync.go

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -36,8 +36,9 @@ var resyncRunnerCmd = &cobra.Command{
3636

3737
if all {
3838
fmt.Println("Resynchronizing all runners")
39-
res, err := runnerapi.ResyncAll(runnerapi.Params{
40-
API: ecctl.Get().API,
39+
res, err := runnerapi.ResyncAll(runnerapi.ResyncAllParams{
40+
API: ecctl.Get().API,
41+
Region: ecctl.Get().Config.Region,
4142
})
4243
if err != nil {
4344
return err
@@ -48,10 +49,9 @@ var resyncRunnerCmd = &cobra.Command{
4849

4950
fmt.Printf("Resynchronizing runner: %s\n", args[0])
5051
return runnerapi.Resync(runnerapi.ResyncParams{
51-
Params: runnerapi.Params{
52-
API: ecctl.Get().API,
53-
},
54-
ID: args[0],
52+
API: ecctl.Get().API,
53+
Region: ecctl.Get().Config.Region,
54+
ID: args[0],
5555
})
5656
},
5757
}

cmd/platform/runner/search.go

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -67,9 +67,8 @@ var searchCmd = &cobra.Command{
6767

6868
r, err := runnerapi.Search(
6969
runnerapi.SearchParams{
70-
Params: runnerapi.Params{
71-
API: ecctl.Get().API,
72-
},
70+
API: ecctl.Get().API,
71+
Region: ecctl.Get().Config.Region,
7372
Request: sr,
7473
})
7574
if err != nil {

cmd/platform/runner/show.go

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -30,10 +30,9 @@ var showCmd = &cobra.Command{
3030
PreRunE: cobra.MinimumNArgs(1),
3131
RunE: func(cmd *cobra.Command, args []string) error {
3232
res, err := runnerapi.Show(runnerapi.ShowParams{
33-
Params: runnerapi.Params{
34-
API: ecctl.Get().API,
35-
},
36-
ID: args[0],
33+
API: ecctl.Get().API,
34+
Region: ecctl.Get().Config.Region,
35+
ID: args[0],
3736
})
3837
if err != nil {
3938
return err

go.mod

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ go 1.12
44

55
require (
66
github.com/asaskevich/govalidator v0.0.0-20190424111038-f61b66f89f4a
7-
github.com/elastic/cloud-sdk-go v1.0.0-beta3.0.20200612072516-470a54b2a398
7+
github.com/elastic/cloud-sdk-go v1.0.0-beta3.0.20200615012742-6982df8d6b10
88
github.com/go-openapi/runtime v0.19.15
99
github.com/go-openapi/strfmt v0.19.5
1010
github.com/pkg/errors v0.9.1

go.sum

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -59,10 +59,8 @@ github.com/dgrijalva/jwt-go v3.2.0+incompatible/go.mod h1:E3ru+11k8xSBh+hMPgOLZm
5959
github.com/dgryski/go-sip13 v0.0.0-20181026042036-e10d5fee7954/go.mod h1:vAd38F8PWV+bWy6jNmig1y/TA+kYO4g3RSRF0IAv0no=
6060
github.com/docker/go-units v0.3.3/go.mod h1:fgPhTUdO+D/Jk86RDLlptpiXQzgHJF7gydDDbaIK4Dk=
6161
github.com/docker/go-units v0.4.0/go.mod h1:fgPhTUdO+D/Jk86RDLlptpiXQzgHJF7gydDDbaIK4Dk=
62-
github.com/elastic/cloud-sdk-go v1.0.0-beta3.0.20200611025421-9b8340580ba3 h1:SdgBG2g5oH05SogNFHvJIRtjfye9Ay4GcEaDIr9n5YE=
63-
github.com/elastic/cloud-sdk-go v1.0.0-beta3.0.20200611025421-9b8340580ba3/go.mod h1:+0Q5izB9Upzmolj6Pq4AkTsBwgDbQnNpODp3qFK7erQ=
64-
github.com/elastic/cloud-sdk-go v1.0.0-beta3.0.20200612072516-470a54b2a398 h1:BGHVBeUGVprGfKdByL+jBLc5Zmf6KScIJaIHFTbTglc=
65-
github.com/elastic/cloud-sdk-go v1.0.0-beta3.0.20200612072516-470a54b2a398/go.mod h1:+0Q5izB9Upzmolj6Pq4AkTsBwgDbQnNpODp3qFK7erQ=
62+
github.com/elastic/cloud-sdk-go v1.0.0-beta3.0.20200615012742-6982df8d6b10 h1:FX0SWzcYKYRd/9EbvsPcnzHc2RNJZqitDKOEMYXy8N8=
63+
github.com/elastic/cloud-sdk-go v1.0.0-beta3.0.20200615012742-6982df8d6b10/go.mod h1:+0Q5izB9Upzmolj6Pq4AkTsBwgDbQnNpODp3qFK7erQ=
6664
github.com/fatih/color v1.7.0/go.mod h1:Zm6kSWBoL9eyXnKyktHP6abPY2pDugNf5KwzbycvMj4=
6765
github.com/fatih/color v1.9.0/go.mod h1:eQcE1qtQxscV5RaZvpXrrb8Drkc3/DdQ+uUYCNjL+zU=
6866
github.com/fsnotify/fsnotify v1.4.7 h1:IXs+QLmnXW2CcXuY+8Mzv/fWEsPGWxqefPtCP5CnV9I=

0 commit comments

Comments
 (0)