Commit ea7065d4 authored by WanLinghao's avatar WanLinghao

fix a bug that --tail option does not take effects in 'kubectl logs --selector xx=xx --tail 3'

parent 5581f52c
...@@ -181,7 +181,7 @@ func (o *LogsOptions) ToLogOptions() (*corev1.PodLogOptions, error) { ...@@ -181,7 +181,7 @@ func (o *LogsOptions) ToLogOptions() (*corev1.PodLogOptions, error) {
logOptions.SinceSeconds = &sec logOptions.SinceSeconds = &sec
} }
if len(o.Selector) > 0 && o.Tail != -1 { if len(o.Selector) > 0 && o.Tail == -1 {
logOptions.TailLines = &selectorTail logOptions.TailLines = &selectorTail
} else if o.Tail != -1 { } else if o.Tail != -1 {
logOptions.TailLines = &o.Tail logOptions.TailLines = &o.Tail
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment