X-Git-Url: https://git.arvados.org/arvados.git/blobdiff_plain/48a3b3a3c28a6590fdf3d2b750192706cb751fae..1a61611cbb8ed4471eb2e04e60bad548bff94678:/sdk/go/arvadostest/stub.go diff --git a/sdk/go/arvadostest/stub.go b/sdk/go/arvadostest/stub.go index 6b24a38fd7..a812a48277 100644 --- a/sdk/go/arvadostest/stub.go +++ b/sdk/go/arvadostest/stub.go @@ -8,7 +8,7 @@ import ( "net/http" "net/url" - "git.curoverse.com/arvados.git/sdk/go/arvados" + "git.arvados.org/arvados.git/sdk/go/arvados" ) // StubResponse struct with response status and body @@ -42,13 +42,20 @@ func (stub *ServerStub) ServeHTTP(resp http.ResponseWriter, req *http.Request) { } // SetServiceURL overrides the given service config/discovery with the -// given internalURL. +// given internalURLs. +// +// ExternalURL is set to the last internalURL, which only aims to +// address the case where there is only one. // // SetServiceURL panics on errors. -func SetServiceURL(service *arvados.Service, internalURL string) { - u, err := url.Parse(internalURL) - if err != nil { - panic(err) +func SetServiceURL(service *arvados.Service, internalURLs ...string) { + service.InternalURLs = map[arvados.URL]arvados.ServiceInstance{} + for _, u := range internalURLs { + u, err := url.Parse(u) + if err != nil { + panic(err) + } + service.InternalURLs[arvados.URL(*u)] = arvados.ServiceInstance{} + service.ExternalURL = arvados.URL(*u) } - service.InternalURLs = map[arvados.URL]arvados.ServiceInstance{arvados.URL(*u): {}} }