Merge branch '17299-uppercase-api'
authorNico Cesar <nico@nicocesar.com>
Wed, 3 Feb 2021 16:19:28 +0000 (11:19 -0500)
committerNico Cesar <nico@nicocesar.com>
Wed, 3 Feb 2021 16:19:28 +0000 (11:19 -0500)
closes #17299

Arvados-DCO-1.1-Signed-off-by: Nico Cesar <nico@curii.com>

sdk/go/arvados/container.go
services/api/app/models/arvados_model.rb
services/api/test/unit/container_test.rb

index 3ff7c52055caf0e6ce72d0f32afc0fa1809007a3..8d65bb40061d88603db66acac16356b90692c7ca 100644 (file)
@@ -89,7 +89,7 @@ type Mount struct {
 // RuntimeConstraints specify a container's compute resources (RAM,
 // CPU) and network connectivity.
 type RuntimeConstraints struct {
-       API          bool  `json:"api"`
+       API          bool  `json:"API"`
        RAM          int64 `json:"ram"`
        VCPUs        int   `json:"vcpus"`
        KeepCacheRAM int64 `json:"keep_cache_ram"`
index 7d5bea8faeb791482be7be26cc47834c42d88db5..f2bae3a4b5b2c79a9a3aacc882b7e570d713bc92 100644 (file)
@@ -877,7 +877,7 @@ class ArvadosModel < ApplicationRecord
   # request.
   def fill_container_defaults
     self.runtime_constraints = {
-      'api' => false,
+      'API' => false,
       'keep_cache_ram' => 0,
       'ram' => 0,
       'vcpus' => 0,
index 4d853852422bc5c7abeadd2b5e3d72601a2d7a37..773a9a8766a640e90bb50468460c4d1def9c457d 100644 (file)
@@ -23,7 +23,7 @@ class ContainerTest < ActiveSupport::TestCase
     command: ["echo", "hello"],
     output_path: "test",
     runtime_constraints: {
-      "api" => false,
+      "API" => false,
       "keep_cache_ram" => 0,
       "ram" => 12000000000,
       "vcpus" => 4,
@@ -229,7 +229,7 @@ class ContainerTest < ActiveSupport::TestCase
     set_user_from_auth :active
     env = {"C" => "3", "B" => "2", "A" => "1"}
     m = {"F" => {"kind" => "3"}, "E" => {"kind" => "2"}, "D" => {"kind" => "1"}}
-    rc = {"vcpus" => 1, "ram" => 1, "keep_cache_ram" => 1, "api" => true}
+    rc = {"vcpus" => 1, "ram" => 1, "keep_cache_ram" => 1, "API" => true}
     c, _ = minimal_new(environment: env, mounts: m, runtime_constraints: rc)
     c.reload
     assert_equal Container.deep_sort_hash(env).to_json, c.environment.to_json