async fn debug_deployment(kube: &ShipKube) -> Result<()> {
    for rs in kube.get_rs().await? {
        if let Ok(r) = ReplicaSetSummary::try_from(rs) {
            // NB: ^ ignore replicasets that didn't parse
            if r.replicas == 0 {
                continue; // also ignore empty ones..
            }
            info!("{} Pod ReplicaSet {} running {}", r.replicas, r.hash, r.version);
            let pods = kube.get_pods_by_template_hash(&r.hash).await?;
            info!("Replicaset contains:");
            debug_pods(pods, kube).await?;
        }
    }
    Ok(())
}
/// Debug a deployment
///
/// Finds active replicasets (with pods in them)
/// Debugs the pods in each replicaset
/// Tails the logs from each broken pod
Debug a deployment
Finds active replicasets (with pods in them)
Debugs the pods in each replicaset
Tails the logs from each broken pod
Debug a deployment Finds active replicasets ( with pods in them ) Debugs the pods in each replicaset Tails the logs from each broken pod
async fn debug_deployment(kube: &ShipKube) -> Result<()> {
    for rs in kube.get_rs().await? {
        if let Ok(r) = ReplicaSetSummary::try_from(rs) {
            // NB: ^ ignore replicasets that didn't parse
            if r.replicas == 0 {
                continue; // also ignore empty ones..
            }
            info!("{} Pod ReplicaSet {} running {}", r.replicas, r.hash, r.version);
            let pods = kube.get_pods_by_template_hash(&r.hash).await?;
            info!("Replicaset contains:");
            debug_pods(pods, kube).await?;
        }
    }
    Ok(())
}
async fn debug_deployment ( kube : & ShipKube ) -> Result < ( ) > { for rs in kube . get_rs ( ) . await ? { if let Ok ( r ) = ReplicaSetSummary :: try_from ( rs ) { // NB: ^ ignore replicasets that didn't parse if r . replicas == 0 { continue ; // also ignore empty ones.. } info ! ( " " r replicas r hash r version ) ; let pods = kube . get_pods_by_template_hash ( & r . hash ) . await ? ; info ! ( " " ) ; debug_pods ( pods , kube ) . await ? ; } } Ok ( ( ) ) }
Debug a deployment
Finds active replicasets (with pods in them)
Debugs the pods in each replicaset
Tails the logs from each broken pod
Debug a deployment Finds active replicasets ( with pods in them ) Debugs the pods in each replicaset Tails the logs from each broken pod
kube
&ShipKube
kube
&ShipKube