Merge pull request #48578 from fabianofranz/run_output_message_on_container_error

Automatic merge from submit-queue (batch tested with PRs 48578, 48895, 48958)

run must output message on container error

**What this PR does / why we need it**: `kubectl run` must output a message (instead of just exiting with an error code) on container error.

**Which issue this PR fixes** *(optional, in `fixes #<issue number>(, fixes #<issue_number>, ...)` format, will close that issue when PR gets merged)*: fixes https://github.com/openshift/origin/issues/15031 found in OpenShift

**Release note**:

```release-note
NONE
```
This commit is contained in:
Kubernetes Submit Queue
2017-07-14 13:45:51 -07:00
committed by GitHub
3 changed files with 3 additions and 4 deletions

View File

@@ -362,7 +362,7 @@ func RunRun(f cmdutil.Factory, cmdIn io.Reader, cmdOut, cmdErr io.Writer, cmd *c
return unknownRcErr
}
return uexec.CodeExitError{
Err: fmt.Errorf("pod %s/%s terminated", pod.Namespace, pod.Name),
Err: fmt.Errorf("pod %s/%s terminated (%s)\n%s", pod.Namespace, pod.Name, pod.Status.ContainerStatuses[0].State.Terminated.Reason, pod.Status.ContainerStatuses[0].State.Terminated.Message),
Code: int(rc),
}
default: