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: add sync delete option #12448

Merged
merged 7 commits into from
Feb 14, 2023
Merged

Conversation

gdsoumya
Copy link
Member

Signed-off-by: Soumya Ghosh Dastidar gdsoumya@gmail.com

Fixes #7124
Depends on argoproj/gitops-engine#507

Thanks to @mvazquezc, the solution proposed works according to my testing. This is the original PR #7125, but because the PRs were pretty old and had merge conflicts I created a fresh one to close it out.

Note on DCO:

If the DCO action in the integration test fails, one or more of your commits are not signed off. Please click on the Details link next to the DCO action for instructions on how to resolve this.

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).

Signed-off-by: Soumya Ghosh Dastidar <gdsoumya@gmail.com>
Signed-off-by: Soumya Ghosh Dastidar <gdsoumya@gmail.com>
@gdsoumya gdsoumya requested a review from alexmt February 14, 2023 04:06
go.mod Outdated
@@ -256,6 +256,7 @@ require (
)

replace (
github.com/argoproj/gitops-engine => github.com/gdsoumya/gitops-engine v0.0.0-20230213130857-26f153a15602
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Will need to merge argoproj/gitops-engine#507 and update the go.mod before merging this PR

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

argoproj/gitops-engine#507 is merged. Please update go.mod

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks! updated.

@codecov
Copy link

codecov bot commented Feb 14, 2023

Codecov Report

Base: 47.62% // Head: 47.62% // No change to project coverage 👍

Coverage data is based on head (744d9e3) compared to base (eb75366).
Patch coverage: 100.00% of modified lines in pull request are covered.

Additional details and impacted files
@@           Coverage Diff           @@
##           master   #12448   +/-   ##
=======================================
  Coverage   47.62%   47.62%           
=======================================
  Files         246      246           
  Lines       41806    41806           
=======================================
  Hits        19911    19911           
  Misses      19902    19902           
  Partials     1993     1993           
Impacted Files Coverage Δ
controller/appcontroller.go 52.27% <100.00%> (ø)

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

☔ View full report at Codecov.
📢 Do you have feedback about the report comment? Let us know in this issue.

Signed-off-by: Soumya Ghosh Dastidar <gdsoumya@gmail.com>
@@ -941,7 +942,7 @@ func (ctrl *ApplicationController) removeProjectFinalizer(proj *appv1.AppProject

// shouldBeDeleted returns whether a given resource obj should be deleted on cascade delete of application app
func (ctrl *ApplicationController) shouldBeDeleted(app *appv1.Application, obj *unstructured.Unstructured) bool {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It should be an easy to test. Can you please add couple unit tests ?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added tests

Signed-off-by: Soumya Ghosh Dastidar <gdsoumya@gmail.com>
@alexmt alexmt enabled auto-merge (squash) February 14, 2023 19:00
@alexmt alexmt merged commit b6cfe67 into argoproj:master Feb 14, 2023
ddecrulle pushed a commit to ddecrulle/argo-cd that referenced this pull request Feb 26, 2023
feat: add sync delete option (argoproj#12448)
Signed-off-by: Dylan Decrulle <dylan.decrulle@outlook.fr>
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.

Allow users to disable deletion for specific objects when application is cascade-deleted
2 participants