Skip to content

HELM_IGNORE_RELEASE is being ignored #748

@gemapayo

Description

@gemapayo

Expected behavior:

Setting HELM_IGNORE_RELEASE=<release-name> should exclude the specified Helm release from the post-converge cleanup, preventing it from being purged as an unmanaged release.

Actual behavior:

HELM_IGNORE_RELEASE has no effect. The operator still discovers the release during DiscoverHelmReleases and schedules a ModulePurge task for it.

Steps to reproduce:

  1. Deploy addon-operator with HELM_IGNORE_RELEASE=my-release set in the environment.
  2. Have a Helm release named my-release in the addon-operator namespace that is not managed as a module.
  3. Wait for the first converge to complete and observe the Operator-PostConvergeCleanup phase.
  4. The release is listed under "Modules to purge found" and a ModulePurge task is created for it despite the env var being set.

Environment:

  • Addon-operator version: v1.19.8

Anything else we should know?:

This is a regression introduced during a refactor that moved HelmIgnoreRelease from a direct global reference (app.HelmIgnoreRelease) to a struct-based options chain (helm.Options → helm3lib.Options → LibClient.HelmIgnoreRelease).

The plumbing was added correctly in pkg/helm/helm.go and pkg/helm/helm3lib/helm3lib.go, but pkg/addon-operator/operator.go was never updated to pass the value through. The HelmIgnoreRelease field is omitted from the helm.Options struct initialization in operator.go, so it defaults to "" and the filter in ListReleasesNames() never matches anything.

This worked correctly in v1.5.3, where helm3lib and helm3 clients referenced app.HelmIgnoreRelease directly.

Fix: Add the missing field in operator.go:

  helmClient, err := helm.InitHelmClientFactory(&helm.Options{
      Namespace:         op.DefaultNamespace,
      HistoryMax:        app.Helm3HistoryMax,
      Timeout:           app.Helm3Timeout,
      HelmIgnoreRelease: app.HelmIgnoreRelease,  // <-- missing
      Logger:            op.Logger.Named("helm"),
  }, op.CRDExtraLabels)

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