Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 6 additions & 5 deletions controller/src/job/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ use k8s_openapi::api::core::v1::Pod;
use k8s_openapi::chrono::{Duration, Utc};
use kube::api::{DeleteParams, ListParams, LogParams, PropagationPolicy};
use kube::{Api, ResourceExt};
use log::{debug, info, warn};
use log::{debug, info, trace, warn};
use snafu::{ensure, OptionExt, ResultExt};
use std::env;
use std::time::{SystemTime, UNIX_EPOCH};
Expand Down Expand Up @@ -206,15 +206,16 @@ pub(crate) async fn archive_logs(k8s_client: kube::Client, job_name: &str) -> Jo
SystemTime::now().duration_since(UNIX_EPOCH)?.as_secs()
);

client
if client
.create_log_stream()
.log_group_name("testsys")
.log_stream_name(&name)
.send()
.await
.context(error::CreateLogStreamSnafu {
log_stream: name.to_string(),
})?;
.is_err()
{
trace!("Unable to create log group it is possible it already exists.");
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A couple of things, you should log the error with {:?}.
You should check for the specific "it already exists" error condition and only ignore that, otherwise issues like authorization, etc could be difficult to diagnose.

}

client
.put_log_events()
Expand Down