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
Proposal: Allow negative/inverse selection for label and resource selectors #10548
Comments
Looks like kubectl supports this. It would be nice to have feature-parity with kubectl. https://stackoverflow.com/a/58936877/684776 |
Hi @crenshaw-dev. |
Hi @crenshaw-dev, can you please review PR #10729 and let me know if any changes are required. |
Hi @crenshaw-dev. Are we looking at implementing the --resource filtering as well? If yes, which wildcard characters should be supported apart from Currently, looks like the resources are selected only if it matches all the criteria - Group, Kind & Name (Namespace, if specified). Filtering based on |
@maheshbaliga I think that could make an excellent follow-up PR! I think just supporting a negate-able glob pattern would be fine (similar to what's available for |
… for list, sync, delete and wait App commands (#10548) Signed-off-by: maheshbaliga <mahesh.baliga@infracloud.io> Signed-off-by: maheshbaliga <mahesh.baliga@infracloud.io>
Hi @crenshaw-dev. Since Is the same behaviour expected with the inclusion of |
That seems like the most intuitive behavior to me. :-) |
… for list, sync, delete and wait App commands (argoproj#10548) Signed-off-by: maheshbaliga <mahesh.baliga@infracloud.io> Signed-off-by: maheshbaliga <mahesh.baliga@infracloud.io>
Hi. I've almost completed |
Hi @crenshaw-dev, can you please review PR #10893 and let me know if any changes are required. |
… wait app commands (#10548) Signed-off-by: maheshbaliga <mahesh.baliga@infracloud.io> Signed-off-by: maheshbaliga <mahesh.baliga@infracloud.io>
… wait app commands (argoproj#10548) Signed-off-by: maheshbaliga <mahesh.baliga@infracloud.io> Signed-off-by: maheshbaliga <mahesh.baliga@infracloud.io> Signed-off-by: emirot <emirot.nolan@gmail.com>
… wait app commands (argoproj#10548) Signed-off-by: maheshbaliga <mahesh.baliga@infracloud.io> Signed-off-by: maheshbaliga <mahesh.baliga@infracloud.io> Signed-off-by: schakrad <chakradari.sindhu@gmail.com>
Summary
When using the
argocd app wait
andargo app sync
commands, it is possible to use the-l / --selector
parameter filter based on labels and their values. It is also possible to use the--resource
filter to only target certain types of resources. Unfortunately it is (as far as I can tell) not possible to do negative/inverse selection on these - for example so that you could filter out resources with a certain label or of a certain type.Motivation
As part of our deployment pipeline, we have a step where we use
argocd app wait <appname> --health --sync
, but the process sometimes gets stuck because of objects in the deployment that continually mark their health asProgressing
and are not always necessary to wait for. I would like to be able to easily filter these objects out of theargocd app wait
call, but as only positive selection is possible, I would have to either:-l
parameter to select those resources. I would like to avoid this since that means adding a label to every single resource besides that particular one that I am trying to avoid.--resource
parameter for every possible resource that is NOT the type of resource that I want to filter out. I would like to avoid this since that means I would have to include every type of resource in use now and it would need to be updated if custom resources are introduced to make sure they are included.Proposal
I would like the
-l / --selector
to allow negative/inverse selection, example:argocd app wait <appname> -l label_example!=hello
Additionally/alternatively it would also be nice if the
--resource
parameter allowed some kind of negative/inverse selection, example:argocd app wait <appname> --resource :!ResourceToFilterOut:
The text was updated successfully, but these errors were encountered: