Description of problem:
if the build fails during an init container we do not grab the last failure log message from the init container and put it in the build's logsnippet. We only do it for the "main" container:
We should also be doing this if we fail in an init container.
Steps to Reproduce:
1. run a build that fails in an init container such as by providing an invalid git url
2. oc describe the build
logSnippet is empty
logSnippet contains the last log line of the init container that failed from pod.status.initContainerStatuses[n].state.terminated.message
Verified in version:
[wewang@wangwen Downloads]$ oc get builds
NAME TYPE FROM STATUS STARTED DURATION
ruby-hello-1 Source Git Failed (FetchSourceFailed) 11 seconds ago 10s
I can't tell from the verification report, were you able to confirm that the LogSnippet value was populated in the build yaml and that it showed some sort of error message from the git clone operation?
Oh, yes I should paste build yaml, here is content of build:
$oc get build -n wewang -o yaml
Cloning "https://github.com/openshift/ruby-hello-world1" ...
error: failed to fetch requested repository "https://github.com/openshift/ruby-hello-world1" with provided credentials
message: Failed to fetch the input source.
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.
For information on the advisory, and where to find the updated
files, follow the link below.
If the solution does not work for you, open a new bug report.