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'
pull/58/head
k8s-ci-robot 2018-11-05 16:32:53 -08:00 committed by GitHub
commit 5656ac754d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 1 deletions

View File

@ -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