6
6
7
7
"github.com/spf13/cobra"
8
8
9
+ corev1 "k8s.io/api/core/v1"
9
10
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
10
11
"k8s.io/apimachinery/pkg/runtime"
11
- kapi "k8s.io/kubernetes/pkg/apis/core"
12
12
kcmd "k8s.io/kubernetes/pkg/kubectl/cmd"
13
13
"k8s.io/kubernetes/pkg/kubectl/cmd/templates"
14
14
kcmdutil "k8s.io/kubernetes/pkg/kubectl/cmd/util"
@@ -82,10 +82,8 @@ type LogsOptions struct {
82
82
83
83
func NewLogsOptions (streams genericclioptions.IOStreams ) * LogsOptions {
84
84
return & LogsOptions {
85
- KubeLogOptions : & kcmd.LogsOptions {
86
- IOStreams : streams ,
87
- },
88
- IOStreams : streams ,
85
+ KubeLogOptions : kcmd .NewLogsOptions (streams , false ),
86
+ IOStreams : streams ,
89
87
}
90
88
}
91
89
@@ -99,7 +97,7 @@ func NewCmdLogs(name, baseName string, f kcmdutil.Factory, streams genericcliopt
99
97
cmd .SuggestFor = []string {"builds" , "deployments" }
100
98
cmd .Run = func (cmd * cobra.Command , args []string ) {
101
99
kcmdutil .CheckErr (o .Complete (f , cmd , args ))
102
- kcmdutil .CheckErr (o .Validate ())
100
+ kcmdutil .CheckErr (o .Validate (args ))
103
101
kcmdutil .CheckErr (o .RunLog ())
104
102
}
105
103
@@ -151,7 +149,7 @@ func (o *LogsOptions) Complete(f kcmdutil.Factory, cmd *cobra.Command, args []st
151
149
152
150
// Validate runs the upstream validation for the logs command and then it
153
151
// will validate any OpenShift-specific log options.
154
- func (o * LogsOptions ) Validate () error {
152
+ func (o * LogsOptions ) Validate (args [] string ) error {
155
153
if err := o .KubeLogOptions .Validate (); err != nil {
156
154
return err
157
155
}
@@ -176,7 +174,7 @@ func (o *LogsOptions) Validate() error {
176
174
// RunLog will run the upstream logs command and may use an OpenShift
177
175
// logOptions object.
178
176
func (o * LogsOptions ) RunLog () error {
179
- podLogOptions := o .KubeLogOptions .Options .(* kapi .PodLogOptions )
177
+ podLogOptions := o .KubeLogOptions .Options .(* corev1 .PodLogOptions )
180
178
infos , err := o .Builder ().
181
179
WithScheme (scheme .Scheme , scheme .Scheme .PrioritizedVersionsAllGroups ()... ).
182
180
NamespaceParam (o .Namespace ).DefaultNamespace ().
0 commit comments