mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-08-04 01:40:07 +00:00
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'
This commit is contained in:
commit
5656ac754d
@ -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
|
||||||
|
Loading…
Reference in New Issue
Block a user