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

[RFE] Support for wildcard in volume ls --filter label=key #12199

Closed
mskarbek opened this issue Nov 7, 2021 · 7 comments · Fixed by #12295
Closed

[RFE] Support for wildcard in volume ls --filter label=key #12199

mskarbek opened this issue Nov 7, 2021 · 7 comments · Fixed by #12295
Labels
kind/feature Categorizes issue or PR as related to a new feature. locked - please file new issue/PR Assist humans wanting to comment on an old issue or PR with locked comments.

Comments

@mskarbek
Copy link

mskarbek commented Nov 7, 2021

Is this a BUG REPORT or FEATURE REQUEST? (leave only one on its own line)

/kind feature

Description

Labels, following k8s standard, have prefix and name parts separated with /. Podman does not enforce strict k8s rules for volume labels, so I'm able to add another part after either / or : depending on which convention I would like to use.
I would like to be able to list all volumes marked with label some.prefix.com/key/* or some.prefix.com/key:*.
This functionality doesn't have to implement full RegEx just simple catch all in place of wildcard.

@openshift-ci openshift-ci bot added the kind/feature Categorizes issue or PR as related to a new feature. label Nov 7, 2021
@flouthoc
Copy link
Collaborator

flouthoc commented Nov 8, 2021

@mskarbek The use case you have specified could be easily matched with HasPrefix but nothing is stopping users from making a query like */secondlabel/anotherlabel/ so i am afraid we will end up implementing regex for this.

I am not also sure if there were any intentions so support multiple labels using delimiters but I'd agree it would be cool thing to add. I'd wait for podman-maintainers perspective on this one.

Thanks for creating the issue.

@flouthoc
Copy link
Collaborator

flouthoc commented Nov 8, 2021

@mskarbek also just to clarify are you expecting wildcards in label keys ?

@mskarbek
Copy link
Author

mskarbek commented Nov 8, 2021

@flouthoc yes, I had keys in mind.

@rhatdan
Copy link
Member

rhatdan commented Nov 8, 2021

Wouldn't piping to grep do what you want? Or do you need this in the API?

@mskarbek
Copy link
Author

mskarbek commented Nov 9, 2021

It's a convenience request for API and Ansible use cases. Ofc it can be worked around.

@rhatdan
Copy link
Member

rhatdan commented Nov 9, 2021

@jwhonce WDYT?

@flouthoc
Copy link
Collaborator

@mskarbek Could you please try above patch. Above patch adds supports to perform pattern based matching on keys. While keeps original behavior intact.

@github-actions github-actions bot added the locked - please file new issue/PR Assist humans wanting to comment on an old issue or PR with locked comments. label Sep 21, 2023
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Sep 21, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
kind/feature Categorizes issue or PR as related to a new feature. locked - please file new issue/PR Assist humans wanting to comment on an old issue or PR with locked comments.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants