Log kaniko errors that happen during the tar phase #6901
Merged
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.
Description
When kaniko has any errors while creating the docker tar context, they are completely lost. This change logs those errors if the kubectl run fails.
I found that if you are using build arguments and you forget to provide them, then those errors surface as tar errors, I think because dependencies are resolved as part of creating the docker tar context.
I am not a go programmer, so I hope that this change is the right way to surface these errors.
Since this is just increasing error logging, I don't think it makes sense to add unit tests.
The other caveat is that you can only see these errors with
concurrency
set to1
, but I think that is a separate bug.