-
Notifications
You must be signed in to change notification settings - Fork 39.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
"kubectl logs" ignores "--tail" option when "--selector" is given #70554
Comments
kubectl logs -l ... --tail ... is buggy. (It always returns 10 lines of output instead of the requested number.) This works around the problem, by adding extra explanations of the issue and providing a shell function as a workaround. See kubernetes/kubernetes#70554 for details.
(It always returns 10 lines of output instead of the requested number.) This works around the problem, by adding extra explanations of the issue and providing a shell function as a workaround. See kubernetes/kubernetes#70554 for details.
(It always returns 10 lines of output instead of the requested number.) This works around the problem, by adding extra explanations of the issue and providing a shell function as a workaround. See kubernetes/kubernetes#70554 for details.
/assign |
didn't that commit just move the code from 3a3633a#diff-0fabd226d454fe805719db043ac4e46bL203 ? |
Not quite; the old code was:
The new code is:
I don't know why it was changed, but the new logic reads as "if the user specified a selector and a number of lines different from -1, then set the number of lines to 10". |
What happened:
I do
kubectl logs --tail 1 --selector run=foo
.I see the last 10 lines of output of each pod matching
run=foo
.What you expected to happen:
I was expecting to see only the last line of output of each pod.
How to reproduce it (as minimally and precisely as possible):
The
jpetazzo/clock
image prints the date every second.Normally we should just see two lines of output; instead we see 20.
Anything else we need to know?:
This seems to be a regression in Kubernetes 1.12, as this worked correctly from 1.8 to 1.11.
(I observed this problem starting with k8s 1.12.0 and it's still present in 1.12.2)
Environment:
kubectl version
): 1.12.2uname -a
): 4.4.0/kind bug
The text was updated successfully, but these errors were encountered: