[ARVADOS] updated: 697a1151c636fc8d19c85a2039cc993298884a23
Git user
git at public.curoverse.com
Thu Jun 1 15:47:49 EDT 2017
Summary of changes:
sdk/go/arvadosclient/arvadosclient.go | 5 +++--
sdk/go/keepclient/discover.go | 7 ++++---
sdk/go/keepclient/keepclient_test.go | 6 +++---
services/keep-web/handler.go | 2 +-
services/keepproxy/keepproxy.go | 1 +
services/keepstore/pull_worker_integration_test.go | 2 +-
tools/keep-block-check/keep-block-check_test.go | 4 ++--
tools/keep-rsync/keep-rsync_test.go | 4 ++--
8 files changed, 17 insertions(+), 14 deletions(-)
via 697a1151c636fc8d19c85a2039cc993298884a23 (commit)
via 41372eb0088174d02505f657f0fa2dabbc845791 (commit)
via 75e00445b6de230493e9ee37483dd4c469db29b1 (commit)
from 916cf89b440fd13a9b9c055d817b34d339442ea3 (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 697a1151c636fc8d19c85a2039cc993298884a23
Author: Tom Clegg <tom at curoverse.com>
Date: Thu Jun 1 15:46:18 2017 -0400
9005: Do not use auth token for keep_services discovery.
Arvados-DCO-1.1-Signed-off-by: Tom Clegg <tom at curoverse.com>
diff --git a/sdk/go/arvadosclient/arvadosclient.go b/sdk/go/arvadosclient/arvadosclient.go
index 7e33ec0..4c4e29f 100644
--- a/sdk/go/arvadosclient/arvadosclient.go
+++ b/sdk/go/arvadosclient/arvadosclient.go
@@ -254,8 +254,9 @@ func (c *ArvadosClient) CallRaw(method string, resourceType string, uuid string,
req.Header.Add("Content-Type", "application/x-www-form-urlencoded")
}
- // Add api token header
- req.Header.Add("Authorization", fmt.Sprintf("OAuth2 %s", c.ApiToken))
+ if c.ApiToken != "" {
+ req.Header.Add("Authorization", "OAuth2 "+c.ApiToken)
+ }
if c.External {
req.Header.Add("X-External-Client", "1")
}
diff --git a/sdk/go/keepclient/discover.go b/sdk/go/keepclient/discover.go
index e2cd329..fde85e0 100644
--- a/sdk/go/keepclient/discover.go
+++ b/sdk/go/keepclient/discover.go
@@ -130,6 +130,7 @@ func (kc *KeepClient) discoverServices() error {
cacheEnt, ok := svcListCache[kc.Arvados.ApiServer]
if !ok {
arv := *kc.Arvados
+ arv.ApiToken = ""
cacheEnt = cachedSvcList{
latest: make(chan svcList),
clear: make(chan struct{}),
commit 41372eb0088174d02505f657f0fa2dabbc845791
Author: Tom Clegg <tom at curoverse.com>
Date: Thu Jun 1 15:31:26 2017 -0400
9005: Restore "refresh services on SIGHUP" to keepproxy.
Arvados-DCO-1.1-Signed-off-by: Tom Clegg <tom at curoverse.com>
diff --git a/services/keepproxy/keepproxy.go b/services/keepproxy/keepproxy.go
index a7aa0e6..7dfd01a 100644
--- a/services/keepproxy/keepproxy.go
+++ b/services/keepproxy/keepproxy.go
@@ -104,6 +104,7 @@ func main() {
if err != nil {
log.Fatalf("Error setting up keep client %s", err.Error())
}
+ keepclient.RefreshServiceDiscoveryOnSIGHUP()
if cfg.PIDFile != "" {
f, err := os.Create(cfg.PIDFile)
commit 75e00445b6de230493e9ee37483dd4c469db29b1
Author: Tom Clegg <tom at curoverse.com>
Date: Thu Jun 1 15:26:42 2017 -0400
9005: Rename ClearCache to RefreshServiceDiscovery
Arvados-DCO-1.1-Signed-off-by: Tom Clegg <tom at curoverse.com>
diff --git a/sdk/go/keepclient/discover.go b/sdk/go/keepclient/discover.go
index c5413d4..e2cd329 100644
--- a/sdk/go/keepclient/discover.go
+++ b/sdk/go/keepclient/discover.go
@@ -15,7 +15,7 @@ import (
)
// ClearCache clears the Keep service discovery cache.
-func ClearCache() {
+func RefreshServiceDiscovery() {
svcListCacheMtx.Lock()
defer svcListCacheMtx.Unlock()
for _, ent := range svcListCache {
@@ -25,7 +25,7 @@ func ClearCache() {
// ClearCacheOnSIGHUP installs a signal handler that calls
// ClearCache when SIGHUP is received.
-func ClearCacheOnSIGHUP() {
+func RefreshServiceDiscoveryOnSIGHUP() {
svcListCacheMtx.Lock()
defer svcListCacheMtx.Unlock()
if svcListCacheSignal != nil {
@@ -35,7 +35,7 @@ func ClearCacheOnSIGHUP() {
signal.Notify(svcListCacheSignal, syscall.SIGHUP)
go func() {
for range svcListCacheSignal {
- ClearCache()
+ RefreshServiceDiscovery()
}
}()
}
diff --git a/sdk/go/keepclient/keepclient_test.go b/sdk/go/keepclient/keepclient_test.go
index ff0f57b..724d7ff 100644
--- a/sdk/go/keepclient/keepclient_test.go
+++ b/sdk/go/keepclient/keepclient_test.go
@@ -36,7 +36,7 @@ type ServerRequiredSuite struct{}
type StandaloneSuite struct{}
func (s *StandaloneSuite) SetUpTest(c *C) {
- ClearCache()
+ RefreshServiceDiscovery()
}
func pythonDir() string {
@@ -55,7 +55,7 @@ func (s *ServerRequiredSuite) TearDownSuite(c *C) {
}
func (s *ServerRequiredSuite) SetUpTest(c *C) {
- ClearCache()
+ RefreshServiceDiscovery()
}
func (s *ServerRequiredSuite) TestMakeKeepClient(c *C) {
@@ -1247,7 +1247,7 @@ func (s *ServerRequiredSuite) TestMakeKeepClientWithNonDiskTypeService(c *C) {
&blobKeepService)
c.Assert(err, Equals, nil)
defer func() { arv.Delete("keep_services", blobKeepService["uuid"].(string), nil, nil) }()
- ClearCache()
+ RefreshServiceDiscovery()
// Make a keepclient and ensure that the testblobstore is included
kc, err := MakeKeepClient(arv)
diff --git a/services/keep-web/handler.go b/services/keep-web/handler.go
index 4ec0a38..b7e39c6 100644
--- a/services/keep-web/handler.go
+++ b/services/keep-web/handler.go
@@ -64,7 +64,7 @@ func parseCollectionIDFromURL(s string) string {
func (h *handler) setup() {
h.clientPool = arvadosclient.MakeClientPool()
- keepclient.ClearCacheOnSIGHUP()
+ keepclient.RefreshServiceDiscoveryOnSIGHUP()
}
// ServeHTTP implements http.Handler.
diff --git a/services/keepstore/pull_worker_integration_test.go b/services/keepstore/pull_worker_integration_test.go
index c0ea4fa..34c2f61 100644
--- a/services/keepstore/pull_worker_integration_test.go
+++ b/services/keepstore/pull_worker_integration_test.go
@@ -29,7 +29,7 @@ func SetupPullWorkerIntegrationTest(t *testing.T, testData PullWorkIntegrationTe
// start api and keep servers
arvadostest.StartAPI()
arvadostest.StartKeep(2, false)
- keepclient.ClearCache()
+ keepclient.RefreshServiceDiscovery()
// make arvadosclient
arv, err := arvadosclient.MakeArvadosClient()
diff --git a/tools/keep-block-check/keep-block-check_test.go b/tools/keep-block-check/keep-block-check_test.go
index 60c5fb5..51a0938 100644
--- a/tools/keep-block-check/keep-block-check_test.go
+++ b/tools/keep-block-check/keep-block-check_test.go
@@ -64,7 +64,7 @@ func (s *DoMainTestSuite) SetUpSuite(c *C) {
func (s *DoMainTestSuite) SetUpTest(c *C) {
logOutput := io.MultiWriter(&logBuffer)
log.SetOutput(logOutput)
- keepclient.ClearCache()
+ keepclient.RefreshServiceDiscovery()
}
func (s *DoMainTestSuite) TearDownTest(c *C) {
@@ -91,7 +91,7 @@ func setupKeepBlockCheckWithTTL(c *C, enforcePermissions bool, keepServicesJSON
c.Assert(ttl, Equals, blobSignatureTTL)
c.Check(err, IsNil)
- keepclient.ClearCache()
+ keepclient.RefreshServiceDiscovery()
}
// Setup test data
diff --git a/tools/keep-rsync/keep-rsync_test.go b/tools/keep-rsync/keep-rsync_test.go
index d17c471..ec0c70f 100644
--- a/tools/keep-rsync/keep-rsync_test.go
+++ b/tools/keep-rsync/keep-rsync_test.go
@@ -99,7 +99,7 @@ func setupRsync(c *C, enforcePermissions bool, replications int) {
// Start Keep servers
arvadostest.StartKeep(3, enforcePermissions)
- keepclient.ClearCache()
+ keepclient.RefreshServiceDiscovery()
// setup keepclients
var err error
@@ -463,7 +463,7 @@ func (s *DoMainTestSuite) Test_doMainWithSrcAndDstConfig(c *C) {
// actual copying to dst will happen, but that's ok.
arvadostest.StartKeep(2, false)
defer arvadostest.StopKeep(2)
- keepclient.ClearCache()
+ keepclient.RefreshServiceDiscovery()
err := doMain()
c.Check(err, IsNil)
-----------------------------------------------------------------------
hooks/post-receive
--
More information about the arvados-commits
mailing list