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: https://github.com/openshift/openshift-controller-manager/blob/5306fa200517c3026064576c45160d9f0ba0eadd/pkg/build/controller/build/build_controller.go#L2358-L2375 We should also be doing this if we fail in an init container. How reproducible: always 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 Actual results: logSnippet is empty Expected results: logSnippet contains the last log line of the init container that failed from pod.status.initContainerStatuses[n].state.terminated.message
Verified in version: 4.5.0-0.nightly-2020-03-22-175100 [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 logSnippet: |- 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.
Perfect, thanks!
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. https://access.redhat.com/errata/RHBA-2020:2409