pub async fn diff_kubectl(mf: &Manifest, tfile: &str) -> Result<Option<String>> {
    let namespace = mf.namespace.clone();
    let pth = Path::new(tfile);
    let (kdiffunobfusc, kdifferr, success) = kubectl::diff(pth.to_path_buf(), &namespace).await?;

    let kubediff = diff::obfuscate_secrets(
        kdiffunobfusc, // move this away quickly..
        mf.get_secrets(),
    );
    debug!("Full diff (obfuscated): \n{}", kubediff);

    if !success {
        let err = kdifferr.trim();
        if err != "exit status 1" {
            warn!("diff {} stderr: {}", mf.name, kdifferr.trim());
            bail!(
                "kubectl diff {} returned: {}",
                mf.name,
                kdifferr.lines().next().unwrap()
            );
        }
    }

    let smalldiff = diff::minify(&kubediff);
    Ok(if !smalldiff.is_empty() {
        debug!("{}", kubediff); // full diff for logs
        println!("{}", smalldiff);
        Some(smalldiff)
    } else {
        None
    })
}
/// Minified kubectl diff shell out
///
/// Requires kubernetes 1.13
Minified kubectl diff shell out
Requires kubernetes 1.13
Minified kubectl diff shell out Requires kubernetes 1 . 13
pub async fn diff_kubectl(mf: &Manifest, tfile: &str) -> Result<Option<String>> {
    let namespace = mf.namespace.clone();
    let pth = Path::new(tfile);
    let (kdiffunobfusc, kdifferr, success) = kubectl::diff(pth.to_path_buf(), &namespace).await?;
    let kubediff = diff::obfuscate_secrets(
        kdiffunobfusc, // move this away quickly..
        mf.get_secrets(),
    );
    debug!("Full diff (obfuscated): \n{}", kubediff);
    if !success {
        let err = kdifferr.trim();
        if err != "exit status 1" {
            warn!("diff {} stderr: {}", mf.name, kdifferr.trim());
            bail!(
                "kubectl diff {} returned: {}",
                mf.name,
                kdifferr.lines().next().unwrap()
            );
        }
    }
    let smalldiff = diff::minify(&kubediff);
    Ok(if !smalldiff.is_empty() {
        debug!("{}", kubediff); // full diff for logs
        println!("{}", smalldiff);
        Some(smalldiff)
    } else {
        None
    })
}
pub async fn diff_kubectl ( mf : & Manifest , tfile : & str ) -> Result < Option < String > > { let namespace = mf . namespace . clone ( ) ; let pth = Path :: new ( tfile ) ; let ( kdiffunobfusc , kdifferr , success ) = kubectl :: diff ( pth . to_path_buf ( ) , & namespace ) . await ? ; let kubediff = diff :: obfuscate_secrets ( kdiffunobfusc , // move this away quickly.. mf . get_secrets ( ) , ) ; debug ! ( " \n " kubediff ) ; if ! success { let err = kdifferr . trim ( ) ; if err != " " { warn ! ( " " mf name kdifferr trim ( ) ) ; bail ! ( " " mf name kdifferr lines ( ) next ( ) unwrap ( ) ) ; } } let smalldiff = diff :: minify ( & kubediff ) ; Ok ( if ! smalldiff . is_empty ( ) { debug ! ( " " kubediff ) ; // full diff for logs println ! ( " " smalldiff ) ; Some ( smalldiff ) } else { None } ) }
Minified kubectl diff shell out
Requires kubernetes 1.13
Minified kubectl diff shell out Requires kubernetes 1 . 13
mf
&Manifest
tfile
&str
mf
&Manifest
tfile
&str