(namespace: &str, obj: DynamicObject)
| 880 | } |
| 881 | |
| 882 | fn sandbox_from_object(namespace: &str, obj: DynamicObject) -> Result<Sandbox, String> { |
| 883 | let id = sandbox_id_from_object(&obj)?; |
| 884 | let name = obj.metadata.name.clone().unwrap_or_default(); |
| 885 | let namespace = obj |
| 886 | .metadata |
| 887 | .namespace |
| 888 | .clone() |
| 889 | .unwrap_or_else(|| namespace.to_string()); |
| 890 | let status = status_from_object(&obj); |
| 891 | |
| 892 | Ok(Sandbox { |
| 893 | id, |
| 894 | name, |
| 895 | namespace, |
| 896 | spec: None, |
| 897 | status, |
| 898 | }) |
| 899 | } |
| 900 | |
| 901 | fn update_indexes( |
| 902 | sandbox_name_to_id: &mut std::collections::HashMap<String, String>, |
no test coverage detected