remove unused stuff
This commit is contained in:
parent
e8e2dcd198
commit
bb9d6ae5ac
22
src/main.rs
22
src/main.rs
|
@ -10,10 +10,10 @@
|
||||||
// * set the pvc storageclass instead
|
// * set the pvc storageclass instead
|
||||||
|
|
||||||
|
|
||||||
use std::f32::consts::E;
|
|
||||||
use std::process::ExitCode;
|
use std::process::ExitCode;
|
||||||
use std::time::Duration;
|
use std::time::Duration;
|
||||||
use std::{future::Future, collections::BTreeMap};
|
use std::{collections::BTreeMap};
|
||||||
use std::sync::Arc;
|
use std::sync::Arc;
|
||||||
use futures::{StreamExt,TryStreamExt};
|
use futures::{StreamExt,TryStreamExt};
|
||||||
use k8s::apimachinery::pkg::api::resource::Quantity;
|
use k8s::apimachinery::pkg::api::resource::Quantity;
|
||||||
|
@ -24,7 +24,7 @@ use anyhow::{bail, anyhow, Result};
|
||||||
use thiserror::Error as ThisError;
|
use thiserror::Error as ThisError;
|
||||||
|
|
||||||
use clap::{Parser as ClapParser, ArgAction};
|
use clap::{Parser as ClapParser, ArgAction};
|
||||||
use tracing::{info, error, debug, trace, Level, Instrument, error_span};
|
use tracing::{info, error, debug, Level, Instrument, error_span};
|
||||||
use tracing_subscriber::FmtSubscriber;
|
use tracing_subscriber::FmtSubscriber;
|
||||||
|
|
||||||
use k8s::api::core::v1::*;
|
use k8s::api::core::v1::*;
|
||||||
|
@ -204,22 +204,8 @@ impl AppContext {
|
||||||
kco.context = context_name;
|
kco.context = context_name;
|
||||||
Ok(kube::Client::try_from(kube::Config::from_kubeconfig(&kco).await?)?)
|
Ok(kube::Client::try_from(kube::Config::from_kubeconfig(&kco).await?)?)
|
||||||
}
|
}
|
||||||
fn ensure<F>(&mut self, f: F) -> EnsureHandle
|
|
||||||
where F: Future<Output = ()> + Send + 'static
|
|
||||||
{
|
|
||||||
let handle = tokio::runtime::Handle::current();
|
|
||||||
let (tx, rx) = tokio::sync::oneshot::channel();
|
|
||||||
self.ensures.push(handle.spawn(async move {
|
|
||||||
let _ = rx.await.unwrap_or_default(); // it's either unit or unit! woo
|
|
||||||
trace!("ensure handler unblocked");
|
|
||||||
f.await;
|
|
||||||
}));
|
|
||||||
tx
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
type EnsureHandle = tokio::sync::oneshot::Sender<()>;
|
|
||||||
|
|
||||||
impl Drop for AppContext {
|
impl Drop for AppContext {
|
||||||
fn drop(&mut self) {
|
fn drop(&mut self) {
|
||||||
let handle = tokio::runtime::Handle::current();
|
let handle = tokio::runtime::Handle::current();
|
||||||
|
@ -244,7 +230,7 @@ trait PodExt {
|
||||||
impl PodExt for Pod {
|
impl PodExt for Pod {
|
||||||
fn label_selectors(&self) -> Vec<String> {
|
fn label_selectors(&self) -> Vec<String> {
|
||||||
let l = self.labels();
|
let l = self.labels();
|
||||||
let mut selectors = Vec::with_capacity(l.len());
|
let selectors = Vec::with_capacity(l.len());
|
||||||
for (k,v) in l.iter() {
|
for (k,v) in l.iter() {
|
||||||
format!("{}={}", k, v);
|
format!("{}={}", k, v);
|
||||||
};
|
};
|
||||||
|
|
Loading…
Reference in New Issue
Block a user