[ARVADOS] updated: 1.2.0-252-g79e1faf11
Git user
git at public.curoverse.com
Mon Oct 22 17:02:05 EDT 2018
Summary of changes:
lib/controller/proxy.go | 4 +---
sdk/go/arvados/client.go | 4 ++--
services/api/app/models/container.rb | 9 ++++++---
services/api/test/unit/container_request_test.rb | 3 +--
4 files changed, 10 insertions(+), 10 deletions(-)
via 79e1faf117ec667aef01247fe1fe79f6588753c0 (commit)
from abad4c1143a7f779df2d9efcdb69b847f05a6acf (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 79e1faf117ec667aef01247fe1fe79f6588753c0
Author: Peter Amstutz <pamstutz at veritasgenetics.com>
Date: Mon Oct 22 17:01:52 2018 -0400
14262: Fix tests
Arvados-DCO-1.1-Signed-off-by: Peter Amstutz <pamstutz at veritasgenetics.com>
diff --git a/lib/controller/proxy.go b/lib/controller/proxy.go
index 9aecdc1b2..b7f3c4f72 100644
--- a/lib/controller/proxy.go
+++ b/lib/controller/proxy.go
@@ -71,9 +71,7 @@ func (p *proxy) ForwardRequest(
ctx := reqIn.Context()
if p.RequestTimeout > 0 {
- var cancel context.CancelFunc
- ctx, cancel = context.WithDeadline(ctx, time.Now().Add(time.Duration(p.RequestTimeout)))
- defer cancel()
+ ctx, _ = context.WithDeadline(ctx, time.Now().Add(time.Duration(p.RequestTimeout)))
}
reqOut := (&http.Request{
diff --git a/sdk/go/arvados/client.go b/sdk/go/arvados/client.go
index 923cecdd5..254a0fa7d 100644
--- a/sdk/go/arvados/client.go
+++ b/sdk/go/arvados/client.go
@@ -103,7 +103,7 @@ var reqIDGen = httpserver.IDGenerator{Prefix: "req-"}
// (*http.Client)Do().
func (c *Client) Do(req *http.Request) (*http.Response, error) {
if c.AuthToken != "" {
- req.Header.Add("Authorization", "OAuth2 "+c.AuthToken)
+ req.Header.Set("Authorization", "OAuth2 "+c.AuthToken)
}
if req.Header.Get("X-Request-Id") == "" {
@@ -215,7 +215,7 @@ func (c *Client) MakeRequest(method, path string, body io.Reader, params interfa
req.Header.Set("Content-type", "application/x-www-form-urlencoded")
if c.AuthToken != "" {
- req.Header.Add("Authorization", "OAuth2 "+c.AuthToken)
+ req.Header.Set("Authorization", "OAuth2 "+c.AuthToken)
}
if req.Header.Get("X-Request-Id") == "" {
diff --git a/services/api/app/models/container.rb b/services/api/app/models/container.rb
index 7d8cc00f2..5d46ac29f 100644
--- a/services/api/app/models/container.rb
+++ b/services/api/app/models/container.rb
@@ -248,11 +248,14 @@ class Container < ArvadosModel
def self.resolve_container_image(container_image)
coll = Collection.for_latest_docker_image(container_image)
if !coll
- # Allow bare pdh without any additional checking otherwise
- # federated container requests won't work.
if loc = Keep::Locator.parse(container_image)
loc.strip_hints!
- return loc.to_s
+ if !Collection.where(portable_data_hash: loc.to_s).any?
+ # Allow bare pdh that doesn't exist in the local database so
+ # that federated container requests which refer to remotely
+ # stored containers will validate.
+ return loc.to_s
+ end
end
raise ArvadosModel::UnresolvableContainerError.new "docker image #{container_image.inspect} not found"
end
diff --git a/services/api/test/unit/container_request_test.rb b/services/api/test/unit/container_request_test.rb
index 8ff216e28..e4c3399c4 100644
--- a/services/api/test/unit/container_request_test.rb
+++ b/services/api/test/unit/container_request_test.rb
@@ -500,8 +500,7 @@ class ContainerRequestTest < ActiveSupport::TestCase
end
end
- ['acbd18db4cc2f85cedef654fccc4a4d8+3',
- 'ENOEXIST',
+ ['ENOEXIST',
'arvados/apitestfixture:ENOEXIST',
].each do |img|
test "container_image_for_container(#{img.inspect}) => 422" do
-----------------------------------------------------------------------
hooks/post-receive
--
More information about the arvados-commits
mailing list