-
Notifications
You must be signed in to change notification settings - Fork 276
Description
If found the following typing errors/inconsistencies in the adminops interface:
-
The fields
User.SupendedandUser.PurgeDataare type*intwhile the API interprets them as booleans (other booleans are typed*bool). -
The integer parameters
QuotaSpec.MaxSizeKbandUser.MaxBucketsare mistyped as*int, while they areint64resp.int32on the rgw side. The width*intin will depend on the architecture in go. (Note: It is unclear how this works when the values are returned as json – technically all numbers in json are double floats, so int64 can not be represented faithfully – unless the serializer/deserializer both ignore this when serializing/deserializing according to a schema).
Of course, fixing those issues would break any code referencing those fields (as their types would change). So it will have to decided what is more important – stability of the library or consistency with the RGW adminops API.
Independently of the decision this matter should be well documented.
Putting values other than 0 or 1 in the ints-as-booleans will result in the parameter being silently ignored (the return value of RESTargs::get_bool is ignored at all call sites): https://github.com/ceph/ceph/blob/193895ffba4245787a2f50bbd5b80132f0e76e74/src/rgw/rgw_rest.cc#L957