(option: &str)
| 2003 | } |
| 2004 | |
| 2005 | fn docker_tmpfs_option(option: &str) -> Result<Vec<String>, Status> { |
| 2006 | let option = option.trim(); |
| 2007 | if option.is_empty() { |
| 2008 | return Err(Status::failed_precondition( |
| 2009 | "tmpfs options must not contain empty values", |
| 2010 | )); |
| 2011 | } |
| 2012 | if let Some((key, value)) = option.split_once('=') { |
| 2013 | let key = key.trim(); |
| 2014 | let value = value.trim(); |
| 2015 | if key.is_empty() || value.is_empty() { |
| 2016 | return Err(Status::failed_precondition( |
| 2017 | "tmpfs key=value options must include both key and value", |
| 2018 | )); |
| 2019 | } |
| 2020 | Ok(vec![key.to_string(), value.to_string()]) |
| 2021 | } else { |
| 2022 | Ok(vec![option.to_string()]) |
| 2023 | } |
| 2024 | } |
| 2025 | |
| 2026 | fn docker_volume_is_bind_backed(volume: &bollard::models::Volume) -> bool { |
| 2027 | volume.driver == "local" |
no test coverage detected