Repository navigation
Conversation
|
Label |
50d3a86 to
c80a053
Compare
An integer driver setting such as Kubernetes `tolerationSeconds` can become a fractional JSON number during protobuf decoding and fail typed configuration parsing. This preserves whole-number values through the shared converter and the actual Kubernetes rendering path. Signed-off-by: Shiju <shiju@nvidia.com>
f9245d5 to
de0645c
Compare
Karthik-Chowdary
left a comment
There was a problem hiding this comment.
Additional wire-level evidence for de0645c23: I exercised the unmodified shared converter from base cc0642fa and this head in an isolated Rust harness, using real prost::Message Struct encode/decode before typed serde parsing.
- A nested PodSpec with
tolerationSecondsof0,512, and9007199254740994(2^53+2) decoded into the actualk8s_openapi::api::core::v1::PodSpecand matched direct JSON on head. Base failed withinvalid type: floating point ... expected i64. - Nested lists of six negative
i64values (including −(2^53+2) andi64::MIN) and all 256i8values also matched direct typed JSON on head; both fail on base. Float/null/bool/string controls remained equal. - Control checks still rejected i8 overflow/fractions and nonexact producer integers; those are existing serde/producer behavior, not new guarantees of this PR.
The five added checks give base 2 passed / 3 failed, head 5 passed. The head helper’s existing ten unit tests also passed. Direct dependencies were pinned to the PR lockfile versions (prost/prost-types 0.14.3, serde 1.0.229, serde_json 1.0.149, k8s-openapi 0.24.0). This verifies binary transport plus shared typed conversion, not driver factories, Kubernetes admission, or live sandbox behavior.
Reproducer: import the unchanged crates/openshell-core/src/proto_struct.rs; form JSON {"spec":{"containers":[],"tolerations":[{"operator":"Exists","effect":"NoExecute","tolerationSeconds":9007199254740994}]}}; call json_object_to_struct, then Struct::decode(proto.encode_to_vec().as_slice()), convert using the production API, and deserialize the resulting spec as PodSpec.
Signed-off-by: Shiju <shiju@nvidia.com>
Summary
A valid integer driver setting, such as Kubernetes
tolerationSeconds, can arrive as a floating-point JSON number after protobuf decoding and fail typed parsing. This preserves exactly represented whole numbers through the shared converter and the Kubernetes rendering path.Related Issue
Closes #5106. Part of #5114.
Changes
Release Notes
Per-sandbox integer driver settings retain their JSON number type. The separate gateway TOML PID-limit path is unchanged.
Testing
Checklist