Skip to content

Apply driftDetection ignore paths to the object sent for the server-side dry-run, not only to the resulting diff #1613

Open

Description

@jnels124

We configure driftDetection.ignore on a HelmRelease for fields of an SGShardedCluster that an in-cluster controller legitimately patches after install (/spec/coordinator/pods/persistentVolume/size, /spec/shards/pods/persistentVolume/size, /spec/shards/overrides). Despite that, the reconcile fails because the target's validating webhook rejects the dry-run: the chart's declared size is smaller than the live size.

Cause

In fluxcd/pkg/ssa/jsondiff (Unstructured()), the helm-controller drift check sends a server-side dry-run Patch of the raw rendered manifest. The ignore paths are only applied afterwards, when generating the diff from a dry-run that already succeeded. So admission webhooks always see the un-ignored value, and a rejection returns a dry-run error before the ignore rules are evaluated.

Expected

Paths covered by driftDetection.ignore keep their live values in the object submitted for the dry-run, so ignored fields can't cause admission failures. kustomize-controller already does this via ApplyOptions.DriftIgnoreRules (fluxcd/pkg#1157), but helm-controller doesn't set it.

Actual

The dry-run uses the chart's value, and the webhook rejects it.

Workaround

Setting helm.toolkit.fluxcd.io/driftDetection: disabled on the resource skips the dry-run, but it disables drift detection for the whole resource, not just the ignored fields.

Environment

  • helm-controller v1.4.5
  • Target: StackGres SGShardedCluster with a validating webhook

Happy to supply logs and the HelmRelease spec.

Activity

  1. lubronzhan commented on Oct 16, 2026

    @lubronzhan
    Contributor

    Yeah fluxcd does SSA dry run here first https://github.com/fluxcd/pkg/blob/ssa/v0.80.0/ssa/jsondiff/unstructured.go#L158-L166
    Then apply filters
    https://github.com/fluxcd/pkg/blob/ssa/v0.80.0/ssa/jsondiff/unstructured.go#L176-L186
    Then for driy run like resizing disk from 10 GB to 5 GB (which is not allowed) will fail.

    So better to apply filters before apply dry run in fluxcd. Make sense. I can create a issue and a fix to fluxcd if you folks are ok

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions