Skip to content

Commit

Permalink
Merge pull request #17006 from php-coder/fix_oc_cluster_up_logs
Browse files Browse the repository at this point in the history
Automatic merge from submit-queue.

oc cluster up: fix "No log available from 'origin' container"

`oc cluster up` fails on my machine and doesn't show the logs:
```
   Error: cannot add privileged SCC to pvinstaller service account
   Details:
     No log available from "origin" container
```
I see the following error, when I'm running it with `--loglevel=8`:
```
I1023 18:54:53.723538   13327 helper.go:206] Error getting container "origin" log: Error response from daemon: {"message":"Bad parameters: you must choose at least one stream"}
```
This PR fixes `Bad parameters: you must choose at least one stream` error by requesting stdout and stderr streams from Docker API.

PTAL @csrwng 
CC @simo5
  • Loading branch information
openshift-merge-robot committed Oct 24, 2017
2 parents 194e07c + d3f41ef commit 230b6a1
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion pkg/oc/bootstrap/docker/dockerhelper/helper.go
Original file line number Diff line number Diff line change
Expand Up @@ -202,7 +202,7 @@ func (h *Helper) HostIP() string {

func (h *Helper) ContainerLog(container string, numLines int) string {
outBuf := &bytes.Buffer{}
if err := h.client.ContainerLogs(container, types.ContainerLogsOptions{Tail: strconv.Itoa(numLines)}, outBuf, outBuf); err != nil {
if err := h.client.ContainerLogs(container, types.ContainerLogsOptions{ShowStdout: true, ShowStderr: true, Tail: strconv.Itoa(numLines)}, outBuf, outBuf); err != nil {
glog.V(2).Infof("Error getting container %q log: %v", container, err)
}
return outBuf.String()
Expand Down

0 comments on commit 230b6a1

Please sign in to comment.