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

Multiple labels do not seem to work #171

Open
diegohavenstein opened this issue Aug 26, 2020 · 0 comments
Open

Multiple labels do not seem to work #171

diegohavenstein opened this issue Aug 26, 2020 · 0 comments

Comments

@diegohavenstein
Copy link

diegohavenstein commented Aug 26, 2020

The README suggests that using multiple labels to match containers is supported:
--label value filter containers by labels, e.g '--label key=value' (multiple labels supported)

When I use a single label, it matches containers and targets them as expected. When I use multiple labels, e.g.
--label key1=value1,key2=value2
no containers are targeted, even though containers exist with labels key1=value1 and key2=value2

In my case, I use the auto-assigned io.kubernetes.container.name key to match the name of my container, and an additional one.

My question is: What is the expected semantics of passing multiple labels? Do all labels need to match (AND semantics) or just one (OR semantics)?

It should be clear in the README what the syntax for multiple labels is (it took me quite a while to figure this out! E.g. --label key1=value1 --label key2=value2 is syntactically wrong), and what its semantics are. It seems to me that none of these works though, as when I have a matching label and a non-matching one nothing gets targeted, which would suggest AND semantics. But if all labels have a match, it does not work, so also not AND semantics. If I use the labels individually (i.e. only key1=value1 or key2=value2) containers are targeted as expected

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants