Skip to content

Commit

Permalink
Fix the issue of removing argocd resources without cascade parameter
Browse files Browse the repository at this point in the history
  • Loading branch information
chilianyi committed May 24, 2023
1 parent 1743166 commit 112e45f
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions pkg/kapis/gitops/v1alpha1/gitops/handler.go
Original file line number Diff line number Diff line change
Expand Up @@ -86,9 +86,7 @@ func (h *Handler) DelApplication(req *restful.Request, res *restful.Response) {
}
err := h.Get(ctx, objectKey, application)
if err == nil {
switch application.Spec.Kind {
case v1alpha1.ArgoCD:
// add the Argo CD resources finalizer if cascade is true
if argo := application.Spec.ArgoApp; argo != nil {
if cascade == "true" {
if k8sutil.AddFinalizer(&application.ObjectMeta, v1alpha1.ArgoCDResourcesFinalizer) {
if err = h.Update(ctx, application); err != nil {
Expand All @@ -102,7 +100,6 @@ func (h *Handler) DelApplication(req *restful.Request, res *restful.Response) {
}
}
}
case v1alpha1.FluxCD:
}
err = h.Delete(ctx, application)
}
Expand Down

0 comments on commit 112e45f

Please sign in to comment.