[ARVADOS] updated: 1.1.3-183-g01126d2
Git user
git at public.curoverse.com
Mon Mar 12 14:53:56 EDT 2018
Summary of changes:
services/api/app/models/container.rb | 2 +-
services/api/test/unit/container_request_test.rb | 8 ++++++++
2 files changed, 9 insertions(+), 1 deletion(-)
via 01126d2f7b8a9134615e0a5f0c933622750db937 (commit)
from 014ccf9cb540d85b153a592f8c882e523e5fa245 (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 01126d2f7b8a9134615e0a5f0c933622750db937
Author: Tom Clegg <tclegg at veritasgenetics.com>
Date: Mon Mar 12 13:35:53 2018 -0400
13143: Remove superfluous check for null hash.
Arvados-DCO-1.1-Signed-off-by: Tom Clegg <tclegg at veritasgenetics.com>
diff --git a/services/api/app/models/container.rb b/services/api/app/models/container.rb
index cff0658..2bb71c3 100644
--- a/services/api/app/models/container.rb
+++ b/services/api/app/models/container.rb
@@ -233,7 +233,7 @@ class Container < ArvadosModel
candidates = candidates.where_serialized(:mounts, resolve_mounts(attrs[:mounts]))
log_reuse_info(candidates) { "after filtering on mounts #{attrs[:mounts].inspect}" }
- candidates = candidates.where('secret_mounts_md5 = ?', Digest::MD5.hexdigest(SafeJSON.dump(self.deep_sort_hash(attrs[:secret_mounts] || {}))))
+ candidates = candidates.where('secret_mounts_md5 = ?', Digest::MD5.hexdigest(SafeJSON.dump(self.deep_sort_hash(attrs[:secret_mounts]))))
log_reuse_info(candidates) { "after filtering on mounts #{attrs[:mounts].inspect}" }
candidates = candidates.where_serialized(:runtime_constraints, resolve_runtime_constraints(attrs[:runtime_constraints]))
diff --git a/services/api/test/unit/container_request_test.rb b/services/api/test/unit/container_request_test.rb
index 89bf917..562662e 100644
--- a/services/api/test/unit/container_request_test.rb
+++ b/services/api/test/unit/container_request_test.rb
@@ -838,16 +838,24 @@ class ContainerRequestTest < ActiveSupport::TestCase
end
end
+ # Note: some of these tests might look redundant because they test
+ # that out-of-order spellings of hashes are still considered equal
+ # regardless of whether the existing (container) or new (container
+ # request) hash needs to be re-ordered.
secrets = {"/foo" => {"kind" => "text", "content" => "xyzzy"}}
same_secrets = {"/foo" => {"content" => "xyzzy", "kind" => "text"}}
different_secrets = {"/foo" => {"kind" => "text", "content" => "something completely different"}}
[
[true, nil, nil],
[true, nil, {}],
+ [true, {}, nil],
[true, {}, {}],
[true, secrets, same_secrets],
+ [true, same_secrets, secrets],
[false, nil, secrets],
[false, {}, secrets],
+ [false, secrets, {}],
+ [false, secrets, nil],
[false, secrets, different_secrets],
].each do |expect_reuse, sm1, sm2|
test "container reuse secret_mounts #{sm1.inspect}, #{sm2.inspect}" do
-----------------------------------------------------------------------
hooks/post-receive
--
More information about the arvados-commits
mailing list