Skip to content

Commit

Permalink
Cargo fix
Browse files Browse the repository at this point in the history
  • Loading branch information
byrnedo committed Aug 8, 2024
1 parent ebf1edc commit 3da2718
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
6 changes: 3 additions & 3 deletions src/get/daemonset.rs
Original file line number Diff line number Diff line change
Expand Up @@ -61,22 +61,22 @@ impl Lister<(usize, String, PodmanPodInfo)> for DaemonsetLister {
"NAMESPACE", "NAME", "DESIRED", "CURRENT", "READY", "UP-TO-DATE", "AVAILABLE", "NODE SELECTOR", "AGE"
);
let num_nodes = items.first().unwrap().0;
let pods = items.into_iter().fold(HashMap::<String, Vec<PodmanPodInfo>>::new(), |mut acc, (num_nodes, depl, pod)| {
let pods = items.into_iter().fold(HashMap::<String, Vec<PodmanPodInfo>>::new(), |mut acc, (_num_nodes, depl, pod)| {
acc.entry(depl).or_insert(vec![]).push(pod);
acc
});

for (name, pods) in pods {
let health_pods = pods.iter().filter(|p| PodmanPodStatus::Running == p.status).collect_vec().len();
let all_pods = pods.len();
let _all_pods = pods.len();
let created = pods.iter().fold(Local::now(), |acc, item| {
if item.created < acc {
return item.created;
}
return acc;
});
let namespace = pods.first().unwrap().labels.get("skate.io/namespace").unwrap_or(&"default".to_string()).clone();
let node_selector = pods.first().unwrap().labels.iter().filter(|(k, _)| k.starts_with("nodeselector/")).map(|(k, v)| k.clone()).collect_vec().join(",");
let node_selector = pods.first().unwrap().labels.iter().filter(|(k, _)| k.starts_with("nodeselector/")).map(|(k, _v)| k.clone()).collect_vec().join(",");

// assuming that we want same number as nodes, that's wrong but anyway
println!(
Expand Down
2 changes: 1 addition & 1 deletion src/skatelet/system.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ use clap::{Args, Subcommand};
use k8s_openapi::api::core::v1::Secret;
use k8s_openapi::ByteString;
use serde::{Deserialize, Serialize};
use serde_yaml::Value;

use podman::PodmanPodInfo;
use crate::filestore::{FileStore, ObjectListItem};

Expand Down
2 changes: 1 addition & 1 deletion src/skatelet/system/podman.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
use std::collections::{BTreeMap, HashMap};
use chrono::{DateTime, Local};
use serde::{Deserialize, Serialize};
use k8s_openapi::api::core::v1::{Pod, PodSpec, PodStatus as K8sPodStatus, Secret};
use k8s_openapi::api::core::v1::{Pod, PodSpec, PodStatus as K8sPodStatus};
use k8s_openapi::apimachinery::pkg::apis::meta::v1::ObjectMeta;
use strum_macros::{Display, EnumString};

Expand Down

0 comments on commit 3da2718

Please sign in to comment.