Skip to content

Commit

Permalink
update log cmd to use corev1.PodLogOptions
Browse files Browse the repository at this point in the history
  • Loading branch information
juanvallejo committed Jul 30, 2018
1 parent f0d449d commit 9fe3318
Show file tree
Hide file tree
Showing 2 changed files with 168 additions and 112 deletions.
10 changes: 5 additions & 5 deletions pkg/oc/cli/logs/logs.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@ import (

"github.com/spf13/cobra"

corev1 "k8s.io/api/core/v1"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/apimachinery/pkg/runtime"
kapi "k8s.io/kubernetes/pkg/apis/core"
kcmd "k8s.io/kubernetes/pkg/kubectl/cmd"
"k8s.io/kubernetes/pkg/kubectl/cmd/templates"
kcmdutil "k8s.io/kubernetes/pkg/kubectl/cmd/util"
Expand Down Expand Up @@ -99,7 +99,7 @@ func NewCmdLogs(name, baseName string, f kcmdutil.Factory, streams genericcliopt
cmd.SuggestFor = []string{"builds", "deployments"}
cmd.Run = func(cmd *cobra.Command, args []string) {
kcmdutil.CheckErr(o.Complete(f, cmd, args))
kcmdutil.CheckErr(o.Validate())
kcmdutil.CheckErr(o.Validate(args))
kcmdutil.CheckErr(o.RunLog())
}

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

// Validate runs the upstream validation for the logs command and then it
// will validate any OpenShift-specific log options.
func (o *LogsOptions) Validate() error {
if err := o.KubeLogOptions.Validate(); err != nil {
func (o *LogsOptions) Validate(args []string) error {
if err := o.KubeLogOptions.Validate(args); err != nil {
return err
}
if o.Options == nil {
Expand All @@ -176,7 +176,7 @@ func (o *LogsOptions) Validate() error {
// RunLog will run the upstream logs command and may use an OpenShift
// logOptions object.
func (o *LogsOptions) RunLog() error {
podLogOptions := o.KubeLogOptions.Options.(*kapi.PodLogOptions)
podLogOptions := o.KubeLogOptions.Options.(*corev1.PodLogOptions)
infos, err := o.Builder().
WithScheme(scheme.Scheme, scheme.Scheme.PrioritizedVersionsAllGroups()...).
NamespaceParam(o.Namespace).DefaultNamespace().
Expand Down
Loading

0 comments on commit 9fe3318

Please sign in to comment.