Skip to content
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

No messages in output when using an array of strings as exclude in config file #302

Closed
Frederick888 opened this issue May 6, 2024 · 1 comment · Fixed by #303
Closed
Assignees
Labels
kind/bug Something isn't working

Comments

@Frederick888
Copy link

What happened:
I created config file with:

exclude: ["abcd"]

Then when I run stern, it just prints out a bunch of pod & container names without messages.

If I change the exclude option to a string, it then started to work normally, i.e.

exclude: "abcd"

(I actually want to add more than one exclude filter to my config file.)

What you expected to happen:
It filters out lines containing abcd.

How to reproduce it (as minimally and precisely as possible):

  1. Create a config file with an array of strings as exclude
  2. Run stern

Anything else we need to know?:

Environment:

  • stern version (use stern --version): 1.29.0
  • OS (e.g: cat /etc/os-release): macOS 14.4.1
  • Install tools (e.g: Homebrew): Homebrew
  • Others: N/A
@Frederick888 Frederick888 added the kind/bug Something isn't working label May 6, 2024
@tksm
Copy link
Contributor

tksm commented May 6, 2024

Hi,

Thank you for reporting the issue.
I confirmed that Stern does not handle the exclude key in the config file properly if the value is an array as follows.

echo 'exclude: ["abcd"]' > /tmp/stern.config
STERNCONFIG=/tmp/stern.config stern --stdin -o raw <<EOF
abcd
a
b
c
d
e
f
xa
xb
xc
xd
xe
xf
EOF

In this case, Stern seems to wrongfully exclude lines that contain a, b, c, and d, even though it expects to exclude only lines with abcd.

e
f
xe
xf

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants