pub async fn diff(pth: PathBuf, ns: &str) -> Result<(String, String, bool)> {
    let args = vec![
        "diff".into(),
        format!("-n={}", ns),
        format!("-f={}", pth.display()),
    ];
    // need the error code here so re-implent - and discard stderr
    debug!("kubectl {}", args.join(" "));

    let s = Command::new("kubectl").args(&args).output().await?;
    let out: String = String::from_utf8_lossy(&s.stdout).into();
    let err: String = String::from_utf8_lossy(&s.stderr).into();
    trace!("out: {}, err: {}", out, err);
    if err.contains("the dryRun alpha feature is disabled") {
        bail!("kubectl diff is not supported in your cluster: {}", err.trim());
    }
    Ok((out, err, s.status.success()))
}
// Kubectl diff experiment (ignores secrets)
Kubectl diff experiment (ignores secrets)
Kubectl diff experiment ( ignores secrets )
pub async fn diff(pth: PathBuf, ns: &str) -> Result<(String, String, bool)> {
    let args = vec![
        "diff".into(),
        format!("-n={}", ns),
        format!("-f={}", pth.display()),
    ];
    // need the error code here so re-implent - and discard stderr
    debug!("kubectl {}", args.join(" "));
    let s = Command::new("kubectl").args(&args).output().await?;
    let out: String = String::from_utf8_lossy(&s.stdout).into();
    let err: String = String::from_utf8_lossy(&s.stderr).into();
    trace!("out: {}, err: {}", out, err);
    if err.contains("the dryRun alpha feature is disabled") {
        bail!("kubectl diff is not supported in your cluster: {}", err.trim());
    }
    Ok((out, err, s.status.success()))
}
pub async fn diff ( pth : PathBuf , ns : & str ) -> Result < ( String , String , bool ) > { let args = vec ! [ " " into ( ) format ( " " ns ) format ( " " pth display ( ) ) ] ; // need the error code here so re-implent - and discard stderr debug ! ( " " args join ( " " ) ) ; let s = Command :: new ( " " ) . args ( & args ) . output ( ) . await ? ; let out : String = String :: from_utf8_lossy ( & s . stdout ) . into ( ) ; let err : String = String :: from_utf8_lossy ( & s . stderr ) . into ( ) ; trace ! ( " " out err ) ; if err . contains ( " " ) { bail ! ( " " err trim ( ) ) ; } Ok ( ( out , err , s . status . success ( ) ) ) }
Kubectl diff experiment (ignores secrets)
Kubectl diff experiment ( ignores secrets )
pth
PathBuf
ns
&str
pth
PathBuf
ns
&str