Skip to content
Merged
Show file tree
Hide file tree
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
6 changes: 6 additions & 0 deletions core-dump-composer/src/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ pub struct CoreParams {
pub hostname: String,
pub pathname: String,
pub namespace: Option<String>,
pub podname: Option<String>,
pub uuid: Uuid,
}

Expand Down Expand Up @@ -64,6 +65,7 @@ impl CoreConfig {
hostname,
pathname,
namespace: None,
podname: None,
uuid,
};

Expand Down Expand Up @@ -165,6 +167,10 @@ impl CoreConfig {
self.params.namespace = Some(namespace)
}

pub fn set_podname(&mut self, podname: String) {
self.params.podname = Some(podname)
}

pub fn get_dump_info_filename(&self) -> String {
format!("{}-dump-info.json", self.get_templated_name())
}
Expand Down
5 changes: 5 additions & 0 deletions core-dump-composer/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,11 @@ fn main() -> Result<(), anyhow::Error> {
.unwrap_or("unknown");

cc.set_namespace(namespace.to_string());

let podname = pod_object["metadata"]["name"].as_str().unwrap_or("unknown");

cc.set_podname(podname.to_string());

// Create the base zip file that we are going to put everything into
let options = FileOptions::default()
.compression_method(zip::CompressionMethod::Deflated)
Expand Down