Skip to content

Commit

Permalink
fix ci and rustfmt
Browse files Browse the repository at this point in the history
  • Loading branch information
tanmaykm committed Jun 23, 2022
1 parent a360dda commit 89010c6
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 deletions.
2 changes: 1 addition & 1 deletion core-dump-agent/tests/basic.rs
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ fn basic() -> Result<(), std::io::Error> {
"FILENAME_TEMPLATE={uuid}-dump-{timestamp}-{hostname}-{exe_name}-{pid}-{signal}"
));
assert!(env_content.contains("LOG_LENGTH=500"));
assert_eq!(env_content.lines().count(), 6);
assert_eq!(env_content.lines().count(), 7);
//TODO: [No9] Test uploading of a corefile
//TODO: [No9] Test remove option
//TODO: [No9] Test sweep option
Expand Down
10 changes: 8 additions & 2 deletions core-dump-composer/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -60,11 +60,17 @@ fn main() -> Result<(), anyhow::Error> {

// match the label filter if there's one, and skip the whole process if it doesn't match
if !cc.pod_selector_label.is_empty() {
debug!("Pod selector specified. Will record only if pod has label {}", &cc.pod_selector_label);
debug!(
"Pod selector specified. Will record only if pod has label {}",
&cc.pod_selector_label
);
let pod_labels = pod_object["metadata"]["labels"].as_object().unwrap();
// check if pod_labels has pod_selector_label
if pod_labels.get(&cc.pod_selector_label).is_none() {
info!("Skipping pod as it did not match selector label {}", &cc.pod_selector_label);
info!(
"Skipping pod as it did not match selector label {}",
&cc.pod_selector_label
);
process::exit(0);
}
} else {
Expand Down

0 comments on commit 89010c6

Please sign in to comment.