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

support filtering resources by label in kapp deploy #272

Closed
jdef opened this issue Aug 12, 2021 · 8 comments · Fixed by #280
Closed

support filtering resources by label in kapp deploy #272

jdef opened this issue Aug 12, 2021 · 8 comments · Fixed by #280
Assignees
Labels
carvel accepted This issue should be considered for future work and that the triage process has been completed enhancement This issue is a feature request

Comments

@jdef
Copy link

jdef commented Aug 12, 2021

What steps did you take:

:; kapp deploy -a 'label:!undefined' -f path/to/yaml

What happened:

kapp: Error: Expected label selector to check for equality

What did you expect:
I expected kapp to deploy all the resources in the yaml since none have a label w/ the key "undefined", and the expression in the attempted command line is supposed to be valid.

Anything else you would like to add:
[Additional information that will assist in solving the issue.]

Environment:

  • kapp version (use kapp --version): 0.37.0
  • OS (e.g. from /etc/os-release):
  • Kubernetes version (use kubectl version)

Vote on this request

This is an invitation to the community to vote on issues, to help us prioritize our backlog. Use the "smiley face" up to the right of this comment to vote.

👍 "I would like to see this addressed as soon as possible"
👎 "There are other more important things to focus on right now"

We are also happy to receive and review Pull Requests if you want to help working on this issue.

@jdef jdef added bug This issue describes a defect or unexpected behavior carvel triage This issue has not yet been reviewed for validity labels Aug 12, 2021
@cppforlife
Copy link
Contributor

cppforlife commented Aug 14, 2021

@jdef -a label:... is not used to filter resources within given yaml. for deploy command it's used to determine what label to apply (add) to resources that will be deployed. (e.g. -a label:foo=bar will result in foo label being set on all created/updated resources). for inspect command -a label:... is used to determine what resources to select from the cluster. same goes for delete command.

it sounds like you want to filter resources for the deploy operation. we have --filter-* flags; however, we do not currently have a flag that filter by label. would be good to add it though.

@cppforlife cppforlife removed the bug This issue describes a defect or unexpected behavior label Aug 14, 2021
@cppforlife cppforlife changed the title negative label selector broken support filtering resources by label in kapp deploy Aug 14, 2021
@cppforlife cppforlife added the enhancement This issue is a feature request label Aug 14, 2021
@jdef
Copy link
Author

jdef commented Aug 14, 2021 via email

@cppforlife
Copy link
Contributor

per similar design, in a slightly different enhancement [0], we should probably introduce --filter '{"resource": {"labelSelector": "x=y"}}' (this builds on our existing way of specifying filters). additionally for as a convenience we could add a sugar flag: --filter-labels 'x=y'. in both cases full label selector syntax should be accepted.

/cc @renuy

[0] #182 (comment)

@renuy
Copy link
Contributor

renuy commented Aug 17, 2021

Summarising: Introduction of a new resource filter flag (--filter-labels). This would be applicable for the following kapp commands:

  • deploy
  • delete
  • inspect
  • app-group deploy
  • tools inspect

@renuy renuy added the carvel accepted This issue should be considered for future work and that the triage process has been completed label Aug 17, 2021
@renuy
Copy link
Contributor

renuy commented Aug 17, 2021

@jdef , adding this issue to the backlog. It is currently not prioritised.
However, we could prioritise a review, if you want to put together a pull request for this.

@jdef
Copy link
Author

jdef commented Aug 17, 2021 via email

@renuy renuy self-assigned this Aug 24, 2021
@renuy renuy linked a pull request Aug 27, 2021 that will close this issue
@renuy renuy closed this as completed Aug 27, 2021
@github-actions github-actions bot removed the carvel triage This issue has not yet been reviewed for validity label Aug 27, 2021
@renuy
Copy link
Contributor

renuy commented Aug 27, 2021

Will be available in release v0.40.0

@github-actions github-actions bot added the carvel triage This issue has not yet been reviewed for validity label Aug 27, 2021
@renuy renuy removed the carvel triage This issue has not yet been reviewed for validity label Aug 30, 2021
@renuy
Copy link
Contributor

renuy commented Sep 23, 2021

release v0.40.0

@github-actions github-actions bot added the carvel triage This issue has not yet been reviewed for validity label Sep 23, 2021
@aaronshurley aaronshurley removed the carvel triage This issue has not yet been reviewed for validity label Nov 30, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
carvel accepted This issue should be considered for future work and that the triage process has been completed enhancement This issue is a feature request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants