Wrap kubectl calls to properly output an error #74
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
We've started experiencing issues with K8S cluster (unrelated to
k8s-buildkite-plugin
) and they slip in askubectl
errors in the middle of our build logs on Buildkite like this:This is due to
k8s-buildkite-plugin
outputting logs in parallel to thewhile true
control loops where we check job/pod status, etc and ANYkubectl
command can fail and print an error that doesn't at all indicate that it is coming fromkubectl
🙃PR wraps all
kubectl
calls, capturesstderr
output and prints it with thekubectl
command parameters so that it is very clearkubectl
failedkubectl
command failed (I've checked the invocations, parameter values don't seem to include any sensitive info like tokens)