summaryrefslogtreecommitdiffhomepage
path: root/tools/unitctl/unit-client-rs
diff options
context:
space:
mode:
authorAva Hahn <a.hahn@f5.com>2024-05-01 13:59:33 -0700
committeravahahn <110854134+avahahn@users.noreply.github.com>2024-05-08 13:30:08 -0700
commit818d4ad76592c87a5c0c7bbd728636023c07daa0 (patch)
tree03a47029b7f609193bee6e26f4fa1a03e2ae2ef9 /tools/unitctl/unit-client-rs
parent6e8f7bbb91e7069d82abd22fbe8d0fcaa1bb2f8c (diff)
downloadunit-818d4ad76592c87a5c0c7bbd728636023c07daa0.tar.gz
unit-818d4ad76592c87a5c0c7bbd728636023c07daa0.tar.bz2
tools/unitctl: API Plumbing for docker deployments
* refactored "instance" command out of enum * plumbed through function stub from client library * error handling Signed-off-by: Ava Hahn <a.hahn@f5.com>
Diffstat (limited to 'tools/unitctl/unit-client-rs')
-rw-r--r--tools/unitctl/unit-client-rs/src/unitd_docker.rs12
1 files changed, 12 insertions, 0 deletions
diff --git a/tools/unitctl/unit-client-rs/src/unitd_docker.rs b/tools/unitctl/unit-client-rs/src/unitd_docker.rs
index d5028afc..0f30ae8a 100644
--- a/tools/unitctl/unit-client-rs/src/unitd_docker.rs
+++ b/tools/unitctl/unit-client-rs/src/unitd_docker.rs
@@ -3,6 +3,7 @@ use std::fs::read_to_string;
use std::path::PathBuf;
use crate::unitd_process::UnitdProcess;
+use crate::unit_client::UnitClientError;
use bollard::secret::ContainerInspectResponse;
use regex::Regex;
@@ -212,6 +213,17 @@ impl UnitdContainer {
}
}
+/* deploys a new docker image of tag $image_tag.
+ * mounts $socket to /var/run in the new container.
+ * mounts $application to /www in the new container. */
+pub fn deploy_new_container(
+ _socket: &String,
+ _application: &String,
+ _image: &String
+) -> Result<(), UnitClientError> {
+ todo!()
+}
+
/* Returns either 64 char docker container ID or None */
pub fn pid_is_dockerized(pid: u64) -> bool {
let cg_filepath = format!("/proc/{}/cgroup", pid);