Merge branch '22168-mount-mknod'
[arvados.git] / sdk / go / arvadosclient / arvadosclient.go
index d0ebdc1b018b9c4039ed0319b77f671b9e5364fe..c87cc97fe4128dd500b8401f7db447258516e404 100644 (file)
@@ -20,6 +20,7 @@ import (
        "time"
 
        "git.arvados.org/arvados.git/sdk/go/arvados"
+       "github.com/sirupsen/logrus"
 )
 
 type StringMatcher func(string) bool
@@ -110,6 +111,9 @@ type ArvadosClient struct {
        // filesystem size.
        DiskCacheSize arvados.ByteSizeOrPercent
 
+       // Where to write debug logs. May be nil.
+       Logger logrus.FieldLogger
+
        // Discovery document
        DiscoveryDoc Dict
 
@@ -120,6 +124,13 @@ type ArvadosClient struct {
 
        // X-Request-Id for outgoing requests
        RequestID string
+
+       // Cluster config from the arvados.Client passed to New(), if
+       // any. If non-nil, its keep services configuration is used
+       // instead of requesting a server list from controller. Note
+       // this is disabled by default in test suites via
+       // ARVADOS_FORCE_KEEP_SERVICES_TABLE environment variable.
+       Cluster *arvados.Cluster
 }
 
 // MakeTLSConfig sets up TLS configuration for communicating with
@@ -150,7 +161,9 @@ func New(c *arvados.Client) (*ArvadosClient, error) {
                Retries:           2,
                KeepServiceURIs:   c.KeepServiceURIs,
                DiskCacheSize:     c.DiskCacheSize,
+               Logger:            c.Logger,
                lastClosedIdlesAt: time.Now(),
+               Cluster:           c.Cluster,
        }
 
        return ac, nil