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

feat: inversion selection support for the resource filter on sync and wait app commands (#10548) #10893

Merged

Conversation

maheshbaliga
Copy link
Contributor

@maheshbaliga maheshbaliga commented Oct 11, 2022

Closes #10548

Implements the --resource flag enhancement.

Sync and Wait commands to manage applications can now be filtered with negative selection of the resources. Matching app resources that satisfy at-least one of the resource filter condition will be selected.

Examples of the inversion filter are:

argocd app wait my-app --resource '!apps:Deployment:my-service'
argocd app sync my-app --resource '!*:Deployment:*'

Checklist:

  • Either (a) I've created an enhancement proposal and discussed it with the community, (b) this is a bug fix, or (c) this does not need to be in the release notes.
  • The title of the PR states what changed and the related issues number (used for the release note).
  • I've included "Closes [ISSUE #]" or "Fixes [ISSUE #]" in the description to automatically close the associated issue.
  • I've updated both the CLI and UI to expose my feature, or I plan to submit a second PR with them.
  • Does this PR require documentation updates?
  • I've updated documentation as required by this PR.
  • Optional. My organization is added to USERS.md.
  • I have signed off all my commits as required by DCO
  • I have written unit and/or e2e tests for my change. PRs without these are unlikely to be merged.
  • My build is green (troubleshooting builds).

@codecov
Copy link

codecov bot commented Oct 11, 2022

Codecov Report

Attention: Patch coverage is 50.79365% with 31 lines in your changes missing coverage. Please review.

Project coverage is 47.30%. Comparing base (a454093) to head (0571d72).
Report is 2158 commits behind head on master.

Files Patch % Lines
cmd/argocd/commands/app.go 48.88% 23 Missing ⚠️
pkg/apis/application/v1alpha1/types.go 0.00% 8 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master   #10893      +/-   ##
==========================================
+ Coverage   47.28%   47.30%   +0.01%     
==========================================
  Files         245      245              
  Lines       41607    41661      +54     
==========================================
+ Hits        19674    19706      +32     
- Misses      19948    19970      +22     
  Partials     1985     1985              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@maheshbaliga maheshbaliga force-pushed the add-negation-to-resource-filter branch 5 times, most recently from 7e3f564 to bbe1445 Compare October 12, 2022 13:35
@maheshbaliga maheshbaliga force-pushed the add-negation-to-resource-filter branch 2 times, most recently from 63fa83b to 9f6cfe9 Compare October 13, 2022 05:21
@maheshbaliga
Copy link
Contributor Author

Hi @crenshaw-dev, can you please review this PR and let me know if any changes are required.

@maheshbaliga maheshbaliga force-pushed the add-negation-to-resource-filter branch from 9f6cfe9 to 80352cc Compare November 21, 2022 08:38
@maheshbaliga maheshbaliga force-pushed the add-negation-to-resource-filter branch 2 times, most recently from 56ede9f to f1ef581 Compare December 5, 2022 04:20
@crenshaw-dev crenshaw-dev enabled auto-merge (squash) January 5, 2023 14:34
@crenshaw-dev
Copy link
Member

@maheshbaliga can you resolve conflicts?

… wait app commands

Signed-off-by: maheshbaliga <mahesh.baliga@infracloud.io>
auto-merge was automatically disabled January 5, 2023 16:26

Head branch was pushed to by a user without write access

@maheshbaliga maheshbaliga force-pushed the add-negation-to-resource-filter branch from f1ef581 to 0571d72 Compare January 5, 2023 16:26
@crenshaw-dev crenshaw-dev merged commit 8ee4387 into argoproj:master Jan 5, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Proposal: Allow negative/inverse selection for label and resource selectors
2 participants