Merge branch '17530-arvados-client-fastfail-take2'
authorNico Cesar <nico@nicocesar.com>
Fri, 16 Apr 2021 21:00:42 +0000 (17:00 -0400)
committerNico Cesar <nico@nicocesar.com>
Fri, 16 Apr 2021 21:00:42 +0000 (17:00 -0400)
closes #17530

Arvados-DCO-1.1-Signed-off-by: Nico Cesar <nico@curii.com>

sdk/go/arvadosclient/arvadosclient.go
sdk/go/keepclient/discover.go

index d90c618f7a1effa8c3da8031cb98909a1b37df3f..4c594625e700d086d7d1a68764b640b247219fda 100644 (file)
@@ -206,6 +206,9 @@ func (c *ArvadosClient) CallRaw(method string, resourceType string, uuid string,
        if scheme == "" {
                scheme = "https"
        }
+       if c.ApiServer == "" {
+               return nil, fmt.Errorf("Arvados client is not configured (target API host is not set). Maybe env var ARVADOS_API_HOST should be set first?")
+       }
        u := url.URL{
                Scheme: scheme,
                Host:   c.ApiServer}
index 726c3fb30c88414cd7e3ea93841084bdfadf61f0..5eafbbe339a9d7d4baa29081a049aa5e924ac61f 100644 (file)
@@ -138,6 +138,10 @@ func (kc *KeepClient) discoverServices() error {
                return nil
        }
 
+       if kc.Arvados.ApiServer == "" {
+               return fmt.Errorf("Arvados client is not configured (target API host is not set). Maybe env var ARVADOS_API_HOST should be set first?")
+       }
+
        svcListCacheMtx.Lock()
        cacheEnt, ok := svcListCache[kc.Arvados.ApiServer]
        if !ok {