[ARVADOS] updated: ce5e483d141207a9adddfb82bc8073caaf555907
Git user
git at public.curoverse.com
Wed Oct 19 05:06:30 EDT 2016
Summary of changes:
services/api/app/models/collection.rb | 2 +-
services/api/test/fixtures/collections.yml | 17 +++++++++++++++--
services/api/test/unit/container_request_test.rb | 10 ++++++----
3 files changed, 22 insertions(+), 7 deletions(-)
via ce5e483d141207a9adddfb82bc8073caaf555907 (commit)
from 99256e7b8649d6be2f380ef9cd1cf506e2bbe8d7 (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 ce5e483d141207a9adddfb82bc8073caaf555907
Author: Tom Clegg <tom at curoverse.com>
Date: Wed Oct 19 05:05:09 2016 -0400
10297: Accept docker images named sha256:{...}.tar when specified by PDH.
diff --git a/services/api/app/models/collection.rb b/services/api/app/models/collection.rb
index 4a05441..8579509 100644
--- a/services/api/app/models/collection.rb
+++ b/services/api/app/models/collection.rb
@@ -314,7 +314,7 @@ class Collection < ArvadosModel
# looks like a saved Docker image.
manifest = Keep::Manifest.new(coll_match.manifest_text)
if manifest.exact_file_count?(1) and
- (manifest.files[0][1] =~ /^[0-9A-Fa-f]{64}\.tar$/)
+ (manifest.files[0][1] =~ /^(sha256:)?[0-9A-Fa-f]{64}\.tar$/)
return [coll_match]
end
end
diff --git a/services/api/test/fixtures/collections.yml b/services/api/test/fixtures/collections.yml
index b1154a8..9f2f410 100644
--- a/services/api/test/fixtures/collections.yml
+++ b/services/api/test/fixtures/collections.yml
@@ -99,7 +99,7 @@ docker_image:
uuid: zzzzz-4zz18-1v45jub259sjjgb
# This Collection has links with Docker image metadata.
portable_data_hash: fa3c1a9cb6783f85f2ecda037e07b8c3+167
- owner_uuid: qr1hi-tpzed-000000000000000
+ owner_uuid: zzzzz-tpzed-000000000000000
created_at: 2014-06-11T17:22:54Z
modified_by_client_uuid: zzzzz-ozdt8-brczlopd8u8d0jr
modified_by_user_uuid: zzzzz-tpzed-d9tiejq69daie8f
@@ -108,12 +108,25 @@ docker_image:
manifest_text: ". d21353cfe035e3e384563ee55eadbb2f+67108864 5c77a43e329b9838cbec18ff42790e57+55605760 0:122714624:d8309758b8fe2c81034ffc8a10c36460b77db7bc5e7b448c4e5b684f9d95a678.tar\n"
name: docker_image
+# untagged docker image with sha256:{hash}.tar filename
+docker_image_1_12:
+ uuid: zzzzz-4zz18-1g4g0vhpjn9wq7i
+ portable_data_hash: d740a57097711e08eb9b2a93518f20ab+174
+ owner_uuid: zzzzz-tpzed-xurymjxw79nv3jz
+ created_at: 2016-10-19 08:50:45.653552268 Z
+ modified_by_client_uuid: zzzzz-ozdt8-teyxzyd8qllg11h
+ modified_by_user_uuid: zzzzz-tpzed-xurymjxw79nv3jz
+ modified_at: 2016-10-19 08:50:45.652930000 Z
+ updated_at: 2016-10-19 08:50:45.652930000 Z
+ manifest_text: ". d21353cfe035e3e384563ee55eadbb2f+67108864 5c77a43e329b9838cbec18ff42790e57+55605760 0:122714624:sha256:d8309758b8fe2c81034ffc8a10c36460b77db7bc5e7b448c4e5b684f9d95a678.tar\n"
+ name: docker_image_1_12
+
unlinked_docker_image:
uuid: zzzzz-4zz18-d0d8z5wofvfgwad
# This Collection contains a file that looks like a Docker image,
# but has no Docker metadata links pointing to it.
portable_data_hash: 9ae44d5792468c58bcf85ce7353c7027+124
- owner_uuid: qr1hi-tpzed-000000000000000
+ owner_uuid: zzzzz-tpzed-000000000000000
created_at: 2014-06-11T17:22:54Z
modified_by_client_uuid: zzzzz-ozdt8-brczlopd8u8d0jr
modified_by_user_uuid: zzzzz-tpzed-d9tiejq69daie8f
diff --git a/services/api/test/unit/container_request_test.rb b/services/api/test/unit/container_request_test.rb
index 1c5c7ae..39f6067 100644
--- a/services/api/test/unit/container_request_test.rb
+++ b/services/api/test/unit/container_request_test.rb
@@ -384,10 +384,12 @@ class ContainerRequestTest < ActiveSupport::TestCase
test "container_image_for_container(pdh)" do
set_user_from_auth :active
- pdh = collections(:docker_image).portable_data_hash
- cr = ContainerRequest.new(container_image: pdh)
- resolved = cr.send :container_image_for_container
- assert_equal resolved, pdh
+ [:docker_image, :docker_image_1_12].each do |coll|
+ pdh = collections(coll).portable_data_hash
+ cr = ContainerRequest.new(container_image: pdh)
+ resolved = cr.send :container_image_for_container
+ assert_equal resolved, pdh
+ end
end
['acbd18db4cc2f85cedef654fccc4a4d8+3',
-----------------------------------------------------------------------
hooks/post-receive
--
More information about the arvados-commits
mailing list