Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Flux HelmRelease not waiting for pre-delete hook job to get completed before uninstalling #4971

Closed
1 task done
MaharaJothi opened this issue Sep 6, 2024 · 2 comments
Closed
1 task done

Comments

@MaharaJothi
Copy link

Describe the bug

I am trying to make use of helm pre-delete hook to clean up certain resources (via Job) before the helm chart is actually uninstalled.
When I run helm uninstall <package-name> the pre-delete hook seems to work fine, that is, the Job gets executed and upon completion the helm chart is uninstalled. However, the same helm chart via HelmRelease runs hook in parallel to helm deletion.

How can I configure HelmRelease to wait for hook to get executed before uninstalling helm chart?
Is it possible to wait for pre-delete hook job to get completed before deleting helm chart in HelmRelease?

Below is my HelmRelease file:

apiVersion: helm.toolkit.fluxcd.io/v2
kind: HelmRelease
metadata:
  name: test
  namespace: test
spec:
  chart:
    spec:
      chart: test-chart
      interval: 5m
      reconcileStrategy: ChartVersion
      sourceRef:
        kind: HelmRepository
        name: my-repo
        namespace: flux-system
      version: 0.1.0
  install:
    remediation:
      retries: 5
  interval: 5m
  uninstall:
    deletionPropagation: foreground
    disableHooks: false
    disableWait: false
    keepHistory: false
    timeout: 2m
  upgrade:
    remediation:
      remediateLastFailure: true
      retries: 5

Steps to reproduce

  1. Create a helm-chart with pre-delete hook of kind Job
  2. Install helm-chart via HelmRelease in Flux
  3. Delete the HelmRelease file

Expected behavior

Job should get executed and upon completion helm chart should get uninstalled

Screenshots and recordings

No response

OS / Distro

NA

Flux version

flux: v2.1.2

Flux check

NA

Git provider

No response

Container Registry provider

No response

Additional context

No response

Code of Conduct

  • I agree to follow this project's Code of Conduct
@stefanprodan
Copy link
Member

I think this is a duplicate of: fluxcd/helm-controller#1021

@kingdonb
Copy link
Member

kingdonb commented Oct 4, 2024

This was fixed in Flux 2.4.0

@kingdonb kingdonb closed this as completed Oct 4, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants