feat: Support for DeleteNamespace SyncOption(#4435, #7875)#11821
feat: Support for DeleteNamespace SyncOption(#4435, #7875)#11821toyamagu-2021 wants to merge 1 commit intoargoproj:masterfrom
Conversation
Codecov ReportBase: 47.32% // Head: 47.34% // Increases project coverage by
Additional details and impacted files@@ Coverage Diff @@
## master #11821 +/- ##
==========================================
+ Coverage 47.32% 47.34% +0.01%
==========================================
Files 245 245
Lines 41545 41584 +39
==========================================
+ Hits 19661 19687 +26
- Misses 19903 19912 +9
- Partials 1981 1985 +4
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. |
d32940b to
b7806cc
Compare
Signed-off-by: toyamagu2021@gmail.com <toyamagu2021@gmail.com>
b7806cc to
84e9afe
Compare
| } | ||
|
|
||
| trackingMethod := argo.GetTrackingMethod(s.settingsMgr) | ||
| nsOwner := argo.NewResourceTracking().GetAppName(unstructedNs, appLabelKey, trackingMethod) |
There was a problem hiding this comment.
How will the app ownership of the namespaces be set? Unless/until something like #11350 is merged, this would need to be a manual process?
| } | ||
|
|
||
| if canDelete { | ||
| err := s.kubeclientset.CoreV1().Namespaces().Delete(ctx, namespace, metav1.DeleteOptions{}) |
There was a problem hiding this comment.
In general any k8s actions happens in gitops-engine, and would probably be the place we'd want to add this.
I suspect that we could do this in a simpler manner though, by force-pruning managed namespaces when an application is deleted (this would likely need to be added in controller/state.go)
|
Thanks for the PR! There are a few outstanding questions which needs to be addressed before definitely saying yay or nay though, the main one being the ownership concept itself - which is the main reason why #11350 has not yet been merged and is currently targeted for 2.7. Once that has been done, we can revisit this and I suspect this will then need to go through a few further rounds of discussion (cc @leoluz, @crenshaw-dev) |
|
@blakepettersson |
|
Is this feature going to be merged/released? or this is closed? |
|
Sorry for left this. I'm afraid this PR should be closed and think more carefully as in #.7875. #.13999, #.15670, and successors might implement this feature. |
Closes #4435
Closes #7875
Description
DeleteNamespacesyncOption, which enables a feature to delete an auto-created namespace.CreateNamespace=trueandDeleteNamespace=trueapp.kubernetes.io/instance=${applicationName}Test
We can test this feature by the following manifest.
After PR #11350 merged, I think
app.kubernetes.io/instanceis automatically labeled.Notes
Because deleting a namespace destroys all resources in the namespace, I think this feature is not breaking but dangerous.
So any suggestions to increase safety would be greatly appreciated.
Template
Signed-off-by: toyamagu2021@gmail.com toyamagu2021@gmail.com
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: