diff options
| author | Ava Hahn <a.hahn@f5.com> | 2024-04-25 20:02:26 -0700 |
|---|---|---|
| committer | avahahn <110854134+avahahn@users.noreply.github.com> | 2024-05-08 13:30:08 -0700 |
| commit | 6e8f7bbb91e7069d82abd22fbe8d0fcaa1bb2f8c (patch) | |
| tree | c4a72ffc97128e5cc2cdc89d58d593cc5914f0cc /tools/unitctl/unit-client-rs/src/unitd_cmd.rs | |
| parent | 5d1ce5c4475f8d126b61650f3c678e3f94549f6b (diff) | |
| download | unit-6e8f7bbb91e7069d82abd22fbe8d0fcaa1bb2f8c.tar.gz unit-6e8f7bbb91e7069d82abd22fbe8d0fcaa1bb2f8c.tar.bz2 | |
tools/unitctl: Initial Docker Procedures
* move UnitdProcess serialization logic into UnitdProcess
* filter out docker processes from process output on Linux
* initial implementation of a UnitdContainer type
* initial implementation of a docker container search for unitd
* pull out custom openapi future executor and use same tokio
runtime as docker client
* refactor openapi client to not manage its own tokio runtime
* process mount points per docker container
* correctly output docker container info in relevant unitd
instances
* create UnitdProcess from UnitdContainer
* UnitdProcess now owns UnitdContainer
* get and parse container details from docker API
* introduce procedure to rewrite file paths based on docker
container mounts
* test path rewrite facilities
* apply path rewrite to unix socket
Signed-off-by: Ava Hahn <a.hahn@f5.com>
Diffstat (limited to 'tools/unitctl/unit-client-rs/src/unitd_cmd.rs')
| -rw-r--r-- | tools/unitctl/unit-client-rs/src/unitd_cmd.rs | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/tools/unitctl/unit-client-rs/src/unitd_cmd.rs b/tools/unitctl/unit-client-rs/src/unitd_cmd.rs index c4883ed5..17563cb0 100644 --- a/tools/unitctl/unit-client-rs/src/unitd_cmd.rs +++ b/tools/unitctl/unit-client-rs/src/unitd_cmd.rs @@ -28,11 +28,13 @@ impl UnitdCmd { .expect("Unable to parse cmd") .splitn(2, " [") .collect::<Vec<&str>>(); + if parts.len() != 2 { let msg = format!("cmd does not have the expected format: {}", process_cmd); return Err(IoError::new(ErrorKind::InvalidInput, msg).into()); } - let version: Option<String> = Some(parts[0].to_string()); + + let version = Some(parts[0].to_string()); let executable_path = UnitdCmd::parse_executable_path_from_cmd(parts[1], binary_name); let flags = UnitdCmd::parse_runtime_flags_from_cmd(parts[1]); @@ -69,6 +71,7 @@ impl UnitdCmd { if cmd.is_empty() { return None; } + // Split out everything in between the brackets [ and ] let split = cmd.trim_end_matches(']').splitn(2, '[').collect::<Vec<&str>>(); if split.is_empty() { |
