Skip to content

Commit 52dcaba

Browse files
committed
update log cmd to use corev1.PodLogOptions
1 parent 89d0cee commit 52dcaba

File tree

2 files changed

+168
-112
lines changed

2 files changed

+168
-112
lines changed

pkg/oc/cli/logs/logs.go

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,9 @@ import (
66

77
"github.com/spf13/cobra"
88

9+
corev1 "k8s.io/api/core/v1"
910
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
1011
"k8s.io/apimachinery/pkg/runtime"
11-
kapi "k8s.io/kubernetes/pkg/apis/core"
1212
kcmd "k8s.io/kubernetes/pkg/kubectl/cmd"
1313
"k8s.io/kubernetes/pkg/kubectl/cmd/templates"
1414
kcmdutil "k8s.io/kubernetes/pkg/kubectl/cmd/util"
@@ -99,7 +99,7 @@ func NewCmdLogs(name, baseName string, f kcmdutil.Factory, streams genericcliopt
9999
cmd.SuggestFor = []string{"builds", "deployments"}
100100
cmd.Run = func(cmd *cobra.Command, args []string) {
101101
kcmdutil.CheckErr(o.Complete(f, cmd, args))
102-
kcmdutil.CheckErr(o.Validate())
102+
kcmdutil.CheckErr(o.Validate(args))
103103
kcmdutil.CheckErr(o.RunLog())
104104
}
105105

@@ -151,8 +151,8 @@ func (o *LogsOptions) Complete(f kcmdutil.Factory, cmd *cobra.Command, args []st
151151

152152
// Validate runs the upstream validation for the logs command and then it
153153
// will validate any OpenShift-specific log options.
154-
func (o *LogsOptions) Validate() error {
155-
if err := o.KubeLogOptions.Validate(); err != nil {
154+
func (o *LogsOptions) Validate(args []string) error {
155+
if err := o.KubeLogOptions.Validate(args); err != nil {
156156
return err
157157
}
158158
if o.Options == nil {
@@ -176,7 +176,7 @@ func (o *LogsOptions) Validate() error {
176176
// RunLog will run the upstream logs command and may use an OpenShift
177177
// logOptions object.
178178
func (o *LogsOptions) RunLog() error {
179-
podLogOptions := o.KubeLogOptions.Options.(*kapi.PodLogOptions)
179+
podLogOptions := o.KubeLogOptions.Options.(*corev1.PodLogOptions)
180180
infos, err := o.Builder().
181181
WithScheme(scheme.Scheme, scheme.Scheme.PrioritizedVersionsAllGroups()...).
182182
NamespaceParam(o.Namespace).DefaultNamespace().

0 commit comments

Comments
 (0)