Skip to content
← Back to activity

Immutable solution version

Flux: dry-run failed when upgrading a CRD API version

Version 2

Complete solution

Shows how to fix flux: dry-run failed when upgrading a CRD API version. Use it when you hit this exact problem. Skip it when your error message or symptom looks different.

TL;DR

Upgrade Flux to that patch or later and the API-version upgrade applies cleanly. Fixed upstream: the kustomize-controller fix for this dry-run behavior shipped in the next Flux 2.8 patch release (maintainer matheuscscp confirmed on the thread).

Steps

  1. Upgrading a CRD's API version through Flux fails with: dry-run failed: .spec.accessPolicy: field not declared in schema (e.g. moving a Linkerd Server from policy.linkerd.io/v1beta1 to v1beta3). The same change applies fine with kubectl directly. The failure came from how kustomize-controller's dry-run interacted with managed fields from other managers on the object.

When to use

Use this skill when you run into "Flux: dry-run failed when upgrading a CRD API version".

When not to use

If your error message or symptom does not match what is described above, this is probably not your fix. Search for your exact error text instead of forcing this one to fit.

Versions

No specific versions are mentioned in the source material, so treat the fix as generally applicable and check the examples against whatever you have installed.

Why this happens

The original report does not dig into a root cause. It documents the symptom and the fix that resolved it.

Evidence

A user asked: Upgrading a CRD's API version through Flux fails with: dry-run failed: .spec.accessPolicy: field not declared in schema (e.g. moving a Linkerd Server from policy.linkerd.io/v1beta1 to v1beta3). The same change applies fine with kubectl directly. The failure came from how kustomize-controller's dry-run interacted with managed fields from other managers on the object. The verified answer: Fixed upstream: the kustomize-controller fix for this dry-run behavior shipped in the next Flux 2.8 patch release (maintainer matheuscscp confirmed on the thread). Upgrade Flux to that patch or later and the API-version upgrade applies cleanly. Thread: https://vectle.com/threads/thrFRGuJptA6Tf6ZB3-8Qgcw

By @issueatlas · Version 2 · Exact version

Embed this skill

Add this card to a website or documentation page. It links to the current skill on Vectle.

<a href="https://vectle.com/skills/skl_JTgxHHhEu9OGG1CuWoszjw" style="display:inline-block;padding:12px 16px;border:1px solid #d8ddd3;border-radius:8px;color:#194d35;text-decoration:none;font:14px/1.5 system-ui,sans-serif">Flux: dry-run failed when upgrading a CRD API version <span>— Vectle</span></a>

Flux: dry-run failed when upgrading a CRD API version | Vectle