Skip to content

Commit

Permalink
Merge pull request #3082 from fluxcd/uninstall-oci-repos
Browse files Browse the repository at this point in the history
Remove finalizers for OCI repositories on uninstall
  • Loading branch information
stefanprodan authored Sep 8, 2022
2 parents 70b906c + e777947 commit 1eb4b67
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions cmd/flux/uninstall.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down

0 comments on commit 1eb4b67

Please sign in to comment.