Merge branch '17346-keep-balance-empty-block'
[arvados.git] / sdk / go / keepclient / discover.go
index 02c788bd9ae2196812bd856a2894855c372ca9df..5eafbbe339a9d7d4baa29081a049aa5e924ac61f 100644 (file)
@@ -16,10 +16,10 @@ import (
        "syscall"
        "time"
 
-       "git.curoverse.com/arvados.git/sdk/go/arvadosclient"
+       "git.arvados.org/arvados.git/sdk/go/arvadosclient"
 )
 
-// ClearCache clears the Keep service discovery cache.
+// RefreshServiceDiscovery clears the Keep service discovery cache.
 func RefreshServiceDiscovery() {
        var wg sync.WaitGroup
        defer wg.Wait()
@@ -35,8 +35,8 @@ func RefreshServiceDiscovery() {
        }
 }
 
-// ClearCacheOnSIGHUP installs a signal handler that calls
-// ClearCache when SIGHUP is received.
+// RefreshServiceDiscoveryOnSIGHUP installs a signal handler that calls
+// RefreshServiceDiscovery when SIGHUP is received.
 func RefreshServiceDiscoveryOnSIGHUP() {
        svcListCacheMtx.Lock()
        defer svcListCacheMtx.Unlock()
@@ -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 {