Remove finalizers for OCI repositories on uninstall

Signed-off-by: Stefan Prodan <stefan.prodan@gmail.com>
pull/3082/head
Stefan Prodan 2 years ago
parent 70b906cae2
commit e777947539
No known key found for this signature in database
GPG Key ID: 3299AEB0E4085BAF

@ -198,6 +198,19 @@ func uninstallFinalizers(ctx context.Context, kubeClient client.Client, dryRun b
} }
} }
} }
{
var list sourcev1.OCIRepositoryList
if err := kubeClient.List(ctx, &list, client.InNamespace("")); err == nil {
for _, r := range list.Items {
r.Finalizers = []string{}
if err := kubeClient.Update(ctx, &r, opts); err != nil {
logger.Failuref("%s/%s/%s removing finalizers failed: %s", r.Kind, r.Namespace, r.Name, err.Error())
} else {
logger.Successf("%s/%s/%s finalizers deleted %s", r.Kind, r.Namespace, r.Name, dryRunStr)
}
}
}
}
{ {
var list sourcev1.HelmRepositoryList var list sourcev1.HelmRepositoryList
if err := kubeClient.List(ctx, &list, client.InNamespace("")); err == nil { if err := kubeClient.List(ctx, &list, client.InNamespace("")); err == nil {

Loading…
Cancel
Save