Skip to content

Commit 96f2f77

Browse files
Merge pull request #18017 from mfojtik/fix-oc-logs
Automatic merge from submit-queue. Fix passing container to pod logs from dc Fixes: #17999 @Kargakis FYI ``` ~/.../openshift/origin → oc logs dc/docker-registry -c second openshift v3.9.0-alpha.1+5643835 kubernetes v1.9.0-beta1 etcd 3.2.8 ~/.../openshift/origin → oc logs dc/docker-registry Error from server (BadRequest): a container name must be specified for pod docker-registry-3-f6grl, choose one of: [second registry] ```
2 parents 887de1b + 502be64 commit 96f2f77

File tree

2 files changed

+2
-0
lines changed

2 files changed

+2
-0
lines changed

pkg/apps/apis/apps/helpers.go

+1
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ import (
1616
// so it shouldn't be included here.
1717
func DeploymentToPodLogOptions(opts *DeploymentLogOptions) *kapi.PodLogOptions {
1818
return &kapi.PodLogOptions{
19+
Container: opts.Container,
1920
Follow: opts.Follow,
2021
SinceSeconds: opts.SinceSeconds,
2122
SinceTime: opts.SinceTime,

pkg/oc/cli/cmd/logs.go

+1
Original file line numberDiff line numberDiff line change
@@ -168,6 +168,7 @@ func (o *OpenShiftLogsOptions) Complete(f *clientcmd.Factory, cmd *cobra.Command
168168

169169
case appsapi.IsResourceOrLegacy("deploymentconfig", gr):
170170
dopts := &appsapi.DeploymentLogOptions{
171+
Container: podLogOptions.Container,
171172
Follow: podLogOptions.Follow,
172173
Previous: podLogOptions.Previous,
173174
SinceSeconds: podLogOptions.SinceSeconds,

0 commit comments

Comments
 (0)