(resources: &mut serde_json::Value, quantity: &str)
| 1931 | } |
| 1932 | |
| 1933 | fn apply_gpu_limit(resources: &mut serde_json::Value, quantity: &str) { |
| 1934 | let Some(resources_obj) = resources.as_object_mut() else { |
| 1935 | *resources = serde_json::json!({}); |
| 1936 | return apply_gpu_limit(resources, quantity); |
| 1937 | }; |
| 1938 | |
| 1939 | let limits = resources_obj |
| 1940 | .entry("limits") |
| 1941 | .or_insert_with(|| serde_json::json!({})); |
| 1942 | let Some(limits_obj) = limits.as_object_mut() else { |
| 1943 | *limits = serde_json::json!({}); |
| 1944 | return apply_gpu_limit(resources, quantity); |
| 1945 | }; |
| 1946 | |
| 1947 | limits_obj.insert(GPU_RESOURCE_NAME.to_string(), serde_json::json!(quantity)); |
| 1948 | } |
| 1949 | |
| 1950 | #[allow(clippy::too_many_arguments)] |
| 1951 | fn build_env_list( |
no outgoing calls
no test coverage detected