diff --git a/cuddle/src/cli/subcommands/kustomize.rs b/cuddle/src/cli/subcommands/kustomize.rs index f0deb6f..bc1cbbd 100644 --- a/cuddle/src/cli/subcommands/kustomize.rs +++ b/cuddle/src/cli/subcommands/kustomize.rs @@ -1,5 +1,6 @@ use std::{io::Write, path::PathBuf}; +use anyhow::Context; use clap::{Arg, ArgMatches, Command}; use crate::cli::CuddleCli; @@ -51,7 +52,7 @@ impl KustomizeCommand { std::fs::create_dir_all(&self.destination)?; let cmd = cmd.arg("kustomize").arg(self.kustomize_folder); - let output = cmd.output()?; + let output = cmd.output().context("failed to run kubectl kustomize")?; if !output.status.success() { anyhow::bail!( @@ -66,13 +67,15 @@ impl KustomizeCommand { .arg(self.destination) .stdin(std::process::Stdio::piped()); - let mut child = cmd.spawn()?; + let mut child = cmd.spawn().context("failed to run kubectl-slice")?; if let Some(mut stdin) = child.stdin.take() { stdin.write_all(&output.stdout)?; } - let output = child.wait_with_output()?; + let output = child + .wait_with_output() + .context("failed to run kubectl-slice")?; if !output.status.success() { anyhow::bail!( "failed to run kustomize: {}",