pub async fn values_vs_kubectl(svc: &str, conf: &Config, region: &Region) -> Result<bool> {
    // Generate crd in a temp file:
    let mf = shipcat_filebacked::load_manifest(svc, conf, region).await?;
    let crd = ShipcatManifest::from(mf);
    let encoded = serde_yaml::to_string(&crd)?;
    let cfile = format!("{}.shipcat.crd.gen.yml", svc);
    let pth = Path::new(".").join(cfile);
    debug!("Writing crd for {} to {}", svc, pth.display());
    let mut f = File::create(&pth)?;
    writeln!(f, "{}", encoded)?;
    // shell out to kubectl:
    let (out, _err, success) = kubectl::diff(pth.clone(), &region.namespace).await?;
    println!("{}", out);
    // cleanup:
    fs::remove_file(pth)?;
    Ok(success)
}
/// Diff values using kubectl diff
///
/// Generate crd as we write it and pipe it to `kubectl diff -`
/// Only works on clusters with kubectl 1.13 on the server side, so not available everywhere
Diff values using kubectl diff
Generate crd as we write it and pipe it to `kubectl diff -`
Only works on clusters with kubectl 1.13 on the server side, so not available everywhere
Diff values using kubectl diff Generate crd as we write it and pipe it to ` kubectl diff - ` Only works on clusters with kubectl 1 . 13 on the server side so not available everywhere
pub async fn values_vs_kubectl(svc: &str, conf: &Config, region: &Region) -> Result<bool> {
    // Generate crd in a temp file:
    let mf = shipcat_filebacked::load_manifest(svc, conf, region).await?;
    let crd = ShipcatManifest::from(mf);
    let encoded = serde_yaml::to_string(&crd)?;
    let cfile = format!("{}.shipcat.crd.gen.yml", svc);
    let pth = Path::new(".").join(cfile);
    debug!("Writing crd for {} to {}", svc, pth.display());
    let mut f = File::create(&pth)?;
    writeln!(f, "{}", encoded)?;
    // shell out to kubectl:
    let (out, _err, success) = kubectl::diff(pth.clone(), &region.namespace).await?;
    println!("{}", out);
    // cleanup:
    fs::remove_file(pth)?;
    Ok(success)
}
pub async fn values_vs_kubectl ( svc : & str , conf : & Config , region : & Region ) -> Result < bool > { // Generate crd in a temp file: let mf = shipcat_filebacked :: load_manifest ( svc , conf , region ) . await ? ; let crd = ShipcatManifest :: from ( mf ) ; let encoded = serde_yaml :: to_string ( & crd ) ? ; let cfile = format ! ( " " svc ) ; let pth = Path :: new ( " " ) . join ( cfile ) ; debug ! ( " " svc pth display ( ) ) ; let mut f = File :: create ( & pth ) ? ; writeln ! ( f " " encoded ) ? ; // shell out to kubectl: let ( out , _err , success ) = kubectl :: diff ( pth . clone ( ) , & region . namespace ) . await ? ; println ! ( " " out ) ; // cleanup: fs :: remove_file ( pth ) ? ; Ok ( success ) }
Diff values using kubectl diff
Generate crd as we write it and pipe it to `kubectl diff -`
Only works on clusters with kubectl 1.13 on the server side, so not available everywhere
Diff values using kubectl diff Generate crd as we write it and pipe it to ` kubectl diff - ` Only works on clusters with kubectl 1 . 13 on the server side so not available everywhere
svc
&str
conf
&Config
region
&Region
svc
&str
conf
&Config
region
&Region