+
+// SetServiceURL overrides the given service config/discovery with the
+// 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, 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)
+ }
+}