[ARVADOS] updated: c103381f05eac510ee3bc51ee001cda7ecb7687a

git at public.curoverse.com git at public.curoverse.com
Tue Jun 17 17:03:01 EDT 2014


Summary of changes:
 .../api/app/controllers/arvados/v1/jobs_controller.rb     |  8 +++++---
 .../functional/arvados/v1/job_reuse_controller_test.rb    | 15 +++++++++++++++
 2 files changed, 20 insertions(+), 3 deletions(-)

       via  c103381f05eac510ee3bc51ee001cda7ecb7687a (commit)
      from  80f048da2da46a41257bab5f9797b497d9978f21 (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 c103381f05eac510ee3bc51ee001cda7ecb7687a
Author: Brett Smith <brett at curoverse.com>
Date:   Tue Jun 17 17:04:02 2014 -0400

    2879: Job Docker filters respect reader tokens.

diff --git a/services/api/app/controllers/arvados/v1/jobs_controller.rb b/services/api/app/controllers/arvados/v1/jobs_controller.rb
index 74bea41..5b1fc9a 100644
--- a/services/api/app/controllers/arvados/v1/jobs_controller.rb
+++ b/services/api/app/controllers/arvados/v1/jobs_controller.rb
@@ -40,8 +40,8 @@ class Arvados::V1::JobsController < ApplicationController
                                                   params[:exclude_script_versions])])
         if image_search = resource_attrs[:runtime_constraints].andand["docker_image"]
           image_tag = resource_attrs[:runtime_constraints]["docker_image_tag"]
-          image_locator =
-            Collection.uuids_for_docker_image(image_search, image_tag).last
+          image_locator = Collection.
+            uuids_for_docker_image(image_search, image_tag, @read_users).last
           return super if image_locator.nil?  # We won't find anything to reuse.
           @filters.append(["docker_image_locator", "=", image_locator])
         else
@@ -190,7 +190,9 @@ class Arvados::V1::JobsController < ApplicationController
         false
       when ["docker_image_locator", "in docker"], ["docker_image_locator", "not in docker"]
         filter[1].sub!(/ docker$/, '')
-        filter[2] = Collection.uuids_for_docker_image(*filter[2].split(':', 2))
+        image_search, image_tag = filter[2].split(':', 2)
+        filter[2] = Collection.
+          uuids_for_docker_image(image_search, image_tag, @read_users)
         true
       else
         true
diff --git a/services/api/test/functional/arvados/v1/job_reuse_controller_test.rb b/services/api/test/functional/arvados/v1/job_reuse_controller_test.rb
index 5cdf6c7..6a3fbe4 100644
--- a/services/api/test/functional/arvados/v1/job_reuse_controller_test.rb
+++ b/services/api/test/functional/arvados/v1/job_reuse_controller_test.rb
@@ -514,4 +514,19 @@ class Arvados::V1::JobReuseControllerTest < ActionController::TestCase
     refute_includes(assigns(:objects).map { |job| job.uuid },
                     jobs(:previous_job_run).uuid)
   end
+
+  test "find Job with Docker image using reader tokens" do
+    authorize_with :inactive
+    get(:index, {
+          filters: [["docker_image_locator", "in docker",
+                     "arvados/apitestfixture"]],
+          reader_tokens: [api_token(:active)],
+        })
+    assert_response :success
+    assert_not_nil assigns(:objects)
+    assert_includes(assigns(:objects).map { |job| job.uuid },
+                    jobs(:previous_docker_job_run).uuid)
+    refute_includes(assigns(:objects).map { |job| job.uuid },
+                    jobs(:previous_job_run).uuid)
+  end
 end

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


hooks/post-receive
-- 




More information about the arvados-commits mailing list