Prevent delete from wiping all artifacts for kind

This commit is contained in:
Hidde Beydals 2020-04-12 21:19:22 +02:00
parent 3e0810aefe
commit 4bde6bf880
3 changed files with 3 additions and 3 deletions

View File

@ -110,7 +110,7 @@ func (r *GitRepositoryReconciler) SetupWithManager(mgr ctrl.Manager) error {
return false
}
// delete artifacts
artifact := r.Storage.ArtifactFor(gvk.Kind, e.Meta, "", "")
artifact := r.Storage.ArtifactFor(gvk.Kind, e.Meta, "*", "")
if err := r.Storage.RemoveAll(artifact); err != nil {
r.Log.Error(err, "unable to delete artifacts",
gvk.Kind, fmt.Sprintf("%s/%s", e.Meta.GetNamespace(), e.Meta.GetName()))

View File

@ -117,7 +117,7 @@ func (r *HelmChartReconciler) SetupWithManager(mgr ctrl.Manager) error {
return false
}
// delete artifacts
artifact := r.Storage.ArtifactFor(gvk.Kind, e.Meta, "", "")
artifact := r.Storage.ArtifactFor(gvk.Kind, e.Meta, "*", "")
if err := r.Storage.RemoveAll(artifact); err != nil {
r.Log.Error(err, "unable to delete artifacts",
gvk.Kind, fmt.Sprintf("%s/%s", e.Meta.GetNamespace(), e.Meta.GetName()))

View File

@ -106,7 +106,7 @@ func (r *HelmRepositoryReconciler) SetupWithManager(mgr ctrl.Manager) error {
return false
}
// delete artifacts
artifact := r.Storage.ArtifactFor(gvk.Kind, e.Meta, "", "")
artifact := r.Storage.ArtifactFor(gvk.Kind, e.Meta, "*", "")
if err := r.Storage.RemoveAll(artifact); err != nil {
r.Log.Error(err, "unable to delete artifacts",
gvk.Kind, fmt.Sprintf("%s/%s", e.Meta.GetNamespace(), e.Meta.GetName()))