Unverified Commit 5656ac75 authored by k8s-ci-robot's avatar k8s-ci-robot Committed by GitHub

Merge pull request #70577 from WanLinghao/kubectl_logs_fix

fix a bug that --tail option does not take effects in 'kubectl logs --selector xx=xx --tail 3'
parents be85dc07 ea7065d4
......@@ -181,7 +181,7 @@ func (o *LogsOptions) ToLogOptions() (*corev1.PodLogOptions, error) {
logOptions.SinceSeconds = &sec
}
if len(o.Selector) > 0 && o.Tail != -1 {
if len(o.Selector) > 0 && o.Tail == -1 {
logOptions.TailLines = &selectorTail
} else if o.Tail != -1 {
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