Bug #17299
[controller] runtime_constraints should be spelled {API:true}, not {api:true}
Start date:
02/03/2021
Due date:
% Done:
100%
Estimated time:
(Total: 0.00 h)
Story points:
-
Release:
Release relationship:
Auto
Description
In #17014 3ec51dcf456b2afe02857089895a261653abddd4 did this
type RuntimeConstraints struct {
- API *bool
+ API bool `json:"api"`
and this
+ self.runtime_constraints = {
+ 'api' => false,
+ 'keep_cache_ram' => 0,
+ 'ram' => 0,
+ 'vcpus' => 0,
+ }.merge(attributes['runtime_constraints'] || {})
As a result:
- when a client submits a CR with {"runtime_constraints":{"API":true}}, controller changes it to {"api":true}
- when railsapi loads a CR from the database that has {"API":true}, it merges with the default {"api":false} and returns {"api":false,"API":true} to the caller and/or the updated database row, which is obviously bad and (sometimes?) causes crunchrun to use the wrong value.
- change the key back to "API" in the Go SDK
- change the key to "API" in the Rails merge-with-default code
A benefit of #17014 is that (with the above fix) railsapi won't see "api" no matter what the client sends -- controller will rewrite it as "API" -- so we shouldn't need any extra checks to prevent future problems.
Subtasks
Associated revisions
History
#1
Updated by Nico César over 1 year ago
- Assigned To set to Nico César
- Status changed from New to In Progress
#2
Updated by Nico César over 1 year ago
c72e7388b50feaf79651719d6e3a7fbe8239c334 17299-uppercase-api
#3
Updated by Nico César over 1 year ago
e60380ca9 17299-uppercase-api
#4
Updated by Tom Clegg over 1 year ago
LGTM, thanks!
#5
Updated by Peter Amstutz over 1 year ago
- Status changed from In Progress to Resolved
#6
Updated by Peter Amstutz about 1 year ago
- Release set to 38
Merge branch '17299-uppercase-api'
closes #17299
Arvados-DCO-1.1-Signed-off-by: Nico Cesar <nico@curii.com>