Skip to content

Add helm.sdk.operatorframework.io/uninstall-failure-ignore or "uninstall-delete-retries" #6572

@cuppett

Description

@cuppett

Feature Request

Describe the problem you need a feature to resolve.

When your helm chart includes a namespace (and things to go into it), you can run into race conditions on delete.

It manifests in an error similar to this:

{"level":"error","ts":"2023-09-16T11:44:55Z","msg":"Reconciler error","controller":"press-controller","object":{"name":"foo","namespace":"ns2"},"namespace":"ns2","name":"foo","reconcileID":"3a7fda50-4d60-4afc-b958-9d1db3277123","error":"failed to delete release: foo","errorVerbose":"failed to delete release: foo\nhelm.sh/helm/v3/pkg/action.(*Uninstall).Run\n\t/go/pkg/mod/helm.sh/helm/v3@v3.11.3/pkg/action/uninstall.go:118\ngithub.com/operator-framework/operator-sdk/internal/helm/release.manager.UninstallRelease\n\t/workspace/internal/helm/release/manager.go:372\ngithub.com/operator-framework/operator-sdk/internal/helm/controller.HelmOperatorReconciler.Reconcile\n\t/workspace/internal/helm/controller/reconcile.go:126\nsigs.k8s.io/controller-runtime/pkg/internal/controller.(*Controller).Reconcile\n\t/go/pkg/mod/sigs.k8s.io/controller-runtime@v0.14.5/pkg/internal/controller/controller.go:122\nsigs.k8s.io/controller-runtime/pkg/internal/controller.(*Controller).reconcileHandler\n\t/go/pkg/mod/sigs.k8s.io/controller-runtime@v0.14.5/pkg/internal/controller/controller.go:323\nsigs.k8s.io/controller-runtime/pkg/internal/controller.(*Controller).processNextWorkItem\n\t/go/pkg/mod/sigs.k8s.io/controller-runtime@v0.14.5/pkg/internal/controller/controller.go:274\nsigs.k8s.io/controller-runtime/pkg/internal/controller.(*Controller).Start.func2.2\n\t/go/pkg/mod/sigs.k8s.io/controller-runtime@v0.14.5/pkg/internal/controller/controller.go:235\nruntime.goexit\n\t/usr/local/go/src/runtime/asm_arm64.s:1172","stacktrace":"sigs.k8s.io/controller-runtime/pkg/internal/controller.(*Controller).reconcileHandler\n\t/go/pkg/mod/sigs.k8s.io/controller-runtime@v0.14.5/pkg/internal/controller/controller.go:329\nsigs.k8s.io/controller-runtime/pkg/internal/controller.(*Controller).processNextWorkItem\n\t/go/pkg/mod/sigs.k8s.io/controller-runtime@v0.14.5/pkg/internal/controller/controller.go:274\nsigs.k8s.io/controller-runtime/pkg/internal/controller.(*Controller).Start.func2.2\n\t/go/pkg/mod/sigs.k8s.io/controller-runtime@v0.14.5/pkg/internal/controller/controller.go:235"}

I've currently got that setup with a helm operator that creates a namespace and several objects within it. The delete of the namespace removes many other objects the helm operator is expecting to be able to remove.

This could also be a general helm issue (should remove namespaces last); however, there may be other reasons objects could get permanently stuck deleting and the user may want to just orphan those for easier cleanup than these CRs (adding an overt annotation for this behavior will allow them to make that choice).

Describe the solution you'd like.

Would like to add an annotation to ignore delete failures and/or keep track of the delete retries before removing the finalizer and allowing the CR to be removed from the system and reconciliation.

This may be useful for both helm and ansible.

/language ansible
/language helm

Metadata

Metadata

Assignees

No one assigned

    Labels

    language/ansibleIssue is related to an Ansible operator projectlanguage/helmIssue is related to a Helm operator projectlifecycle/rottenDenotes an issue or PR that has aged beyond stale and will be auto-closed.triage/needs-informationIndicates an issue needs more information in order to work on it.

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions