Skip to content

Commit 4bde6bf

Browse files
committed
Prevent delete from wiping all artifacts for kind
1 parent 3e0810a commit 4bde6bf

3 files changed

Lines changed: 3 additions & 3 deletions

File tree

controllers/gitrepository_controller.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,7 @@ func (r *GitRepositoryReconciler) SetupWithManager(mgr ctrl.Manager) error {
110110
return false
111111
}
112112
// delete artifacts
113-
artifact := r.Storage.ArtifactFor(gvk.Kind, e.Meta, "", "")
113+
artifact := r.Storage.ArtifactFor(gvk.Kind, e.Meta, "*", "")
114114
if err := r.Storage.RemoveAll(artifact); err != nil {
115115
r.Log.Error(err, "unable to delete artifacts",
116116
gvk.Kind, fmt.Sprintf("%s/%s", e.Meta.GetNamespace(), e.Meta.GetName()))

controllers/helmchart_controller.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,7 @@ func (r *HelmChartReconciler) SetupWithManager(mgr ctrl.Manager) error {
117117
return false
118118
}
119119
// delete artifacts
120-
artifact := r.Storage.ArtifactFor(gvk.Kind, e.Meta, "", "")
120+
artifact := r.Storage.ArtifactFor(gvk.Kind, e.Meta, "*", "")
121121
if err := r.Storage.RemoveAll(artifact); err != nil {
122122
r.Log.Error(err, "unable to delete artifacts",
123123
gvk.Kind, fmt.Sprintf("%s/%s", e.Meta.GetNamespace(), e.Meta.GetName()))

controllers/helmrepository_controller.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,7 @@ func (r *HelmRepositoryReconciler) SetupWithManager(mgr ctrl.Manager) error {
106106
return false
107107
}
108108
// delete artifacts
109-
artifact := r.Storage.ArtifactFor(gvk.Kind, e.Meta, "", "")
109+
artifact := r.Storage.ArtifactFor(gvk.Kind, e.Meta, "*", "")
110110
if err := r.Storage.RemoveAll(artifact); err != nil {
111111
r.Log.Error(err, "unable to delete artifacts",
112112
gvk.Kind, fmt.Sprintf("%s/%s", e.Meta.GetNamespace(), e.Meta.GetName()))

0 commit comments

Comments
 (0)