Skip to content

Commit

Permalink
Print output when kind create cluster fails (#2126)
Browse files Browse the repository at this point in the history
  • Loading branch information
divergentdave authored Oct 13, 2023
1 parent fc48112 commit 18ce8ef
Showing 1 changed file with 11 additions and 6 deletions.
17 changes: 11 additions & 6 deletions core/src/test_util/kubernetes.rs
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,7 @@ impl EphemeralCluster {
// lockstep with the version of kind installed by the ci-build workflow.
// https://github.com/kubernetes-sigs/kind/releases/tag/v0.17.0
// https://cloud.google.com/kubernetes-engine/docs/release-notes#regular-channel
assert!(Command::new("kind")
let output = Command::new("kind")
.args([
"create",
"cluster",
Expand All @@ -194,11 +194,16 @@ impl EphemeralCluster {
577c630ce8e509131eab1aea12c022190978dd2f745aac5eb1fe65c0807eb315",
])
.stdin(Stdio::null())
.stdout(Stdio::null())
.stderr(Stdio::null())
.status()
.unwrap()
.success());
.stdout(Stdio::piped())
.stderr(Stdio::piped())
.output()
.unwrap();
assert!(
output.status.success(),
"`kind create cluster` failed\nstdout: {}\nstderr: {}",
String::from_utf8_lossy(&output.stdout),
String::from_utf8_lossy(&output.stderr),
);

Self {
// Kind prefixes the cluster name with "kind-" when creating a kubectl context
Expand Down

0 comments on commit 18ce8ef

Please sign in to comment.