Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feature/nanocld: introduced process trait #809

Merged
merged 14 commits into from
Jan 9, 2024
57 changes: 24 additions & 33 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion bin/nanocl/src/commands/cargo.rs
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ async fn exec_cargo_restart(
let client = &cli_conf.client;
for name in &opts.names {
client
.restart_cargo(name, args.namespace.as_deref())
.restart_process("cargo", name, args.namespace.as_deref())
.await?;
}
Ok(())
Expand Down
11 changes: 6 additions & 5 deletions bin/nanocl/src/commands/job.rs
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
use futures::StreamExt;
use nanocl_error::io::{IoResult, FromIo, IoError};

use nanocld_client::stubs::job::JobWaitQuery;
use nanocld_client::stubs::process::ProcessLogQuery;
use nanocld_client::stubs::process::{ProcessLogQuery, ProcessWaitQuery};

use crate::utils;
use crate::config::CliConfig;
Expand Down Expand Up @@ -86,10 +85,12 @@ async fn exec_job_wait(
) -> IoResult<()> {
let client = &cli_conf.client;
let mut stream = client
.wait_job(
.wait_process(
"job",
&opts.name,
Some(&JobWaitQuery {
Some(&ProcessWaitQuery {
condition: opts.condition.clone(),
namespace: None,
}),
)
.await?;
Expand All @@ -102,7 +103,7 @@ async fn exec_job_wait(
if resp.status_code != 0 {
eprintln!(
"Job container {}-{} ended with error code {}",
opts.name, resp.container_name, resp.status_code,
opts.name, resp.process_name, resp.status_code,
);
has_error = true;
}
Expand Down
2 changes: 1 addition & 1 deletion bin/nanocl/src/models/job.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ use tabled::Tabled;
use chrono::TimeZone;
use clap::{Parser, Subcommand};

use nanocld_client::stubs::job::{WaitCondition, JobSummary};
use nanocld_client::stubs::{job::JobSummary, process::WaitCondition};

use super::{DisplayFormat, GenericListOpts};

Expand Down
Loading
Loading