kubetail icon indicating copy to clipboard operation
kubetail copied to clipboard

feat: add container match pattern (regex)

Open lad1337 opened this issue 6 years ago • 1 comments

As we are using some auto injected containers into our pods (linkerd) and i still want to be able to follow multiple pods that have different containers i added a container name filter option.

example

kubetail '.*mypod-http.+|.*mypod-background.+' -C '.*mypod.*' -e regex

-C is short for --container-pattern which defaults to .*

note: i'm not sure how to format the help text with the long name container-pattern

lad1337 avatar Feb 20 '19 11:02 lad1337

Hi! Thanks for the PR!

What happens when you specify both a normal container name (1) and a container pattern (2)? From what I understand it first tries to match on (1) and only those that matches (1) are eligible for (2)? Is this correct? Should this really be the case? Perhaps it's easier to understand, and it's more consistent with how pod matching works, if it's strictly either (1) or (2)?

johanhaleby avatar Feb 21 '19 07:02 johanhaleby