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"
@@ -84,6 +84,7 @@ func NewLogsOptions(streams genericclioptions.IOStreams) *LogsOptions {
84
84
return & LogsOptions {
85
85
KubeLogOptions : & kcmd.LogsOptions {
86
86
IOStreams : streams ,
87
+ Tail : - 1 ,
87
88
},
88
89
IOStreams : streams ,
89
90
}
@@ -99,7 +100,7 @@ func NewCmdLogs(name, baseName string, f kcmdutil.Factory, streams genericcliopt
99
100
cmd .SuggestFor = []string {"builds" , "deployments" }
100
101
cmd .Run = func (cmd * cobra.Command , args []string ) {
101
102
kcmdutil .CheckErr (o .Complete (f , cmd , args ))
102
- kcmdutil .CheckErr (o .Validate ())
103
+ kcmdutil .CheckErr (o .Validate (args ))
103
104
kcmdutil .CheckErr (o .RunLog ())
104
105
}
105
106
@@ -151,7 +152,7 @@ func (o *LogsOptions) Complete(f kcmdutil.Factory, cmd *cobra.Command, args []st
151
152
152
153
// Validate runs the upstream validation for the logs command and then it
153
154
// will validate any OpenShift-specific log options.
154
- func (o * LogsOptions ) Validate () error {
155
+ func (o * LogsOptions ) Validate (args [] string ) error {
155
156
if err := o .KubeLogOptions .Validate (); err != nil {
156
157
return err
157
158
}
@@ -176,7 +177,7 @@ func (o *LogsOptions) Validate() error {
176
177
// RunLog will run the upstream logs command and may use an OpenShift
177
178
// logOptions object.
178
179
func (o * LogsOptions ) RunLog () error {
179
- podLogOptions := o .KubeLogOptions .Options .(* kapi .PodLogOptions )
180
+ podLogOptions := o .KubeLogOptions .Options .(* corev1 .PodLogOptions )
180
181
infos , err := o .Builder ().
181
182
WithScheme (scheme .Scheme , scheme .Scheme .PrioritizedVersionsAllGroups ()... ).
182
183
NamespaceParam (o .Namespace ).DefaultNamespace ().
0 commit comments