# WithHelmChartForceConflicts

- Module: [Aspire.Hosting.Kubernetes](/reference/api/go/aspire.hosting.kubernetes.md)
- Version: `13.6.5-preview.1.26559.7`
- Kind: `method`
- Defined on: [`KubernetesHelmChartResource`](/reference/api/go/aspire.hosting.kubernetes/kuberneteshelmchartresource.md)
- Source: [GitHub](https://github.com/microsoft/aspire/tree/b33d222049f1ecc3bc7257ec07b622fe550b2580)

Opts the Helm chart in to `helm upgrade --install --force-conflicts`. When set, Helm's server-side apply forcibly takes over any fields owned by another field manager instead of failing with a conflict.

## Remarks

This is most commonly needed for charts whose templates ship admission webhooks
(cert-manager, kyverno, gatekeeper, opa-gatekeeper, etc.) on clusters where another
admission controller -- such as the AKS `admissionsenforcer` field manager
installed by the Azure Policy add-on or Deployment Safeguards -- mutates the webhook
configuration after install. Helm's Server-Side Apply (used by default for charts
that opt in, including cert-manager) refuses to overwrite fields owned by another
field manager. Without `--force-conflicts`, the next `helm upgrade` fails
with a "conflict with admissionsenforcer" error on the webhook's
`namespaceSelector` (or similar).
See
Deployment Safeguards in AKS
and
Server-Side Apply conflicts
for background.
Unlike the deprecated `--force` / `--force-replace` (which delete and
recreate the resource and are incompatible with Server-Side Apply),
`--force-conflicts` is non-destructive -- it only changes which field manager
owns the conflicting field. No resources are deleted or recreated. This flag is
also distinct from Helm's `--take-ownership`, which transfers ownership of an
entire resource between Helm releases and does not address field-level conflicts.
Requires Helm v3.18 or later (the version that introduced `--force-conflicts`
for `helm upgrade --install`). Older Helm versions fail with
`Error: unknown flag: --force-conflicts`.

## Definition

```go
func (KubernetesHelmChartResource) WithHelmChartForceConflicts() KubernetesHelmChartResource
```

## Returns

[`KubernetesHelmChartResource`](/reference/api/go/aspire.hosting.kubernetes/kuberneteshelmchartresource.md) -- The resource builder for chaining.

Returns a handle; failures surface later via `Err()`.

## Applies to

- [`KubernetesHelmChartResource`](/reference/api/go/aspire.hosting.kubernetes/kuberneteshelmchartresource.md)
