Actions
Bug #17299
closed[controller] runtime_constraints should be spelled {API:true}, not {api:true}
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.
Updated by Nico César almost 4 years ago
- Assigned To set to Nico César
- Status changed from New to In Progress
Updated by Nico César almost 4 years ago
c72e7388b50feaf79651719d6e3a7fbe8239c334 17299-uppercase-api
Updated by Nico César almost 4 years ago
e60380ca9 17299-uppercase-api
Updated by Peter Amstutz almost 4 years ago
- Status changed from In Progress to Resolved
Actions