Skip to content

Flux2 Does not honour dependsOn defined in the HelmRelease for the Termination Flow #5586

@NikhilTejSR

Description

@NikhilTejSR

Describe the bug

We have noticed that during installation, when committing all HelmRelease YAMLs together, Flux correctly honors the dependsOn relationships and applies resources in order. However, on deletion, if all HelmRelease YAMLs are removed in a single commit, Flux does not follow the same dependency order—leading to issues like stuck terminations.

Steps to reproduce

Install Sequence:
With this, HelmRelease1 will be installed first, then HelmRelease2 and lastly HelmRelease3 => dependsOn works here

Terminate Sequence:
For Terminate it should be opposite, first HelmRelease3 terminate, then Helm Release2 Terminate and lastly HelmRelease3 Terminate. => dependsOn do not work here

Expected behavior

We would like termination to work the same way as installation, so that manual, multi-commit deletion and monitoring can be avoided. This would ensure a consistent and reliable experience for both install and uninstall operations.

Screenshots and recordings

No response

OS / Distro

RHEL9

Flux version

v2.6.4

Flux check

]# flux check
► checking prerequisites
✗ Kubernetes version v1.29.10+67d3387 does not match >=1.31.0-0
► checking version in cluster
✔ distribution: flux-v2.6.4
✔ bootstrapped: true
► checking controllers
✔ helm-controller: deployment ready
► image-registry.openshift-image-registry.svc:5000/flux-system/helm-controller:v1.3.0
✔ image-automation-controller: deployment ready
► image-registry.openshift-image-registry.svc:5000/flux-system/image-automation-controller:v0.41.2
✔ image-reflector-controller: deployment ready
► image-registry.openshift-image-registry.svc:5000/flux-system/image-reflector-controller:v0.35.2
✔ kustomize-controller: deployment ready
► image-registry.openshift-image-registry.svc:5000/flux-system/kustomize-controller:v1.6.1
✔ notification-controller: deployment ready
► image-registry.openshift-image-registry.svc:5000/flux-system/notification-controller:v1.6.0
✔ source-controller: deployment ready
► image-registry.openshift-image-registry.svc:5000/flux-system/source-controller:v1.6.2
► checking crds
✔ alerts.notification.toolkit.fluxcd.io/v1beta3
✔ buckets.source.toolkit.fluxcd.io/v1
✔ gitrepositories.source.toolkit.fluxcd.io/v1
✔ helmcharts.source.toolkit.fluxcd.io/v1
✔ helmreleases.helm.toolkit.fluxcd.io/v2
✔ helmrepositories.source.toolkit.fluxcd.io/v1
✔ imagepolicies.image.toolkit.fluxcd.io/v1beta2
✔ imagerepositories.image.toolkit.fluxcd.io/v1beta2
✔ imageupdateautomations.image.toolkit.fluxcd.io/v1beta2
✔ kustomizations.kustomize.toolkit.fluxcd.io/v1
✔ ocirepositories.source.toolkit.fluxcd.io/v1
✔ providers.notification.toolkit.fluxcd.io/v1beta3
✔ receivers.notification.toolkit.fluxcd.io/v1
✗ check failed

Git provider

Gitlab

Container Registry provider

OCI

Additional context

No response

Code of Conduct

  • I agree to follow this project's Code of Conduct

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions