[ARVADOS] updated: acfc0f5ac83618591adbe0b3bf3e6fed2ed6b03b

Git user git at public.curoverse.com
Fri Jul 22 10:25:28 EDT 2016


Summary of changes:
 sdk/go/arvados/client.go | 19 ++++++++++++++++---
 1 file changed, 16 insertions(+), 3 deletions(-)

       via  acfc0f5ac83618591adbe0b3bf3e6fed2ed6b03b (commit)
      from  af57f2401366e9d67627b93b12d2096d771a9985 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.


commit acfc0f5ac83618591adbe0b3bf3e6fed2ed6b03b
Author: Tom Clegg <tom at curoverse.com>
Date:   Fri Jul 22 09:59:32 2016 -0400

    9550: Add service discovery override field to new SDK.

diff --git a/sdk/go/arvados/client.go b/sdk/go/arvados/client.go
index 3d8fa55..f95152b 100644
--- a/sdk/go/arvados/client.go
+++ b/sdk/go/arvados/client.go
@@ -10,6 +10,7 @@ import (
 	"net/http"
 	"net/url"
 	"os"
+	"strings"
 	"time"
 )
 
@@ -33,6 +34,13 @@ type Client struct {
 	// Accept unverified certificates. This works only if the
 	// Client field is nil: otherwise, it has no effect.
 	Insecure bool
+
+	// Override keep service discovery with a list of base
+	// URIs. (Currently there are no Client methods for
+	// discovering keep services so this is just a convenience for
+	// callers who use a Client to initialize an
+	// arvadosclient.ArvadosClient.)
+	KeepServiceURIs []string
 }
 
 // The default http.Client used by a Client with Insecure==true and
@@ -51,10 +59,15 @@ var DefaultSecureClient = &http.Client{
 // client with the API endpoint and credentials given by the
 // ARVADOS_API_* environment variables.
 func NewClientFromEnv() *Client {
+	var svcs []string
+	if s := os.Getenv("ARVADOS_KEEP_SERVICES"); s != "" {
+		svcs = strings.Split(s, " ")
+	}
 	return &Client{
-		APIHost:   os.Getenv("ARVADOS_API_HOST"),
-		AuthToken: os.Getenv("ARVADOS_API_TOKEN"),
-		Insecure:  os.Getenv("ARVADOS_API_HOST_INSECURE") != "",
+		APIHost:         os.Getenv("ARVADOS_API_HOST"),
+		AuthToken:       os.Getenv("ARVADOS_API_TOKEN"),
+		Insecure:        os.Getenv("ARVADOS_API_HOST_INSECURE") != "",
+		KeepServiceURIs: svcs,
 	}
 }
 

-----------------------------------------------------------------------


hooks/post-receive
-- 




More information about the arvados-commits mailing list