Merge pull request #3082 from fluxcd/uninstall-oci-repos

Remove finalizers for OCI repositories on uninstall
pull/3088/head
Stefan Prodan 2 years ago committed by GitHub
commit 1eb4b67013
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -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
if err := kubeClient.List(ctx, &list, client.InNamespace("")); err == nil {

Loading…
Cancel
Save