pub async fn template_vs_kubectl(mf: &Manifest) -> Result<Option<String>> {
    // Generate template in a temp file:
    let tfile = format!("{}.shipcat.tpl.gen.yml", mf.name);
    let pth = Path::new(".").join(tfile);

    let _tpl = helm::template(&mf, Some(pth.clone())).await?;

    let (out, err, success) = kubectl::diff(pth.clone(), &mf.namespace).await?;
    // cleanup:
    fs::remove_file(pth)?;
    if !success && !err.is_empty() && err.trim() != "exit status 1" {
        println!("kubectl diff stderr: {}", err.trim());
    }
    if !out.is_empty() {
        Ok(Some(out))
    } else {
        Ok(None)
    }
}
/// Diff using template kubectl diff
///
/// Generate template 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 using template kubectl diff
Generate template 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 using template kubectl diff Generate template 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 template_vs_kubectl(mf: &Manifest) -> Result<Option<String>> {
    // Generate template in a temp file:
    let tfile = format!("{}.shipcat.tpl.gen.yml", mf.name);
    let pth = Path::new(".").join(tfile);
    let _tpl = helm::template(&mf, Some(pth.clone())).await?;
    let (out, err, success) = kubectl::diff(pth.clone(), &mf.namespace).await?;
    // cleanup:
    fs::remove_file(pth)?;
    if !success && !err.is_empty() && err.trim() != "exit status 1" {
        println!("kubectl diff stderr: {}", err.trim());
    }
    if !out.is_empty() {
        Ok(Some(out))
    } else {
        Ok(None)
    }
}
pub async fn template_vs_kubectl ( mf : & Manifest ) -> Result < Option < String > > { // Generate template in a temp file: let tfile = format ! ( " " mf name ) ; let pth = Path :: new ( " " ) . join ( tfile ) ; let _tpl = helm :: template ( & mf , Some ( pth . clone ( ) ) ) . await ? ; let ( out , err , success ) = kubectl :: diff ( pth . clone ( ) , & mf . namespace ) . await ? ; // cleanup: fs :: remove_file ( pth ) ? ; if ! success && ! err . is_empty ( ) && err . trim ( ) != " " { println ! ( " " err trim ( ) ) ; } if ! out . is_empty ( ) { Ok ( Some ( out ) ) } else { Ok ( None ) } }
Diff using template kubectl diff
Generate template 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 using template kubectl diff Generate template 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
mf
&Manifest
mf
&Manifest