Skip to content

fix: add explicit conversion.strategy to CRDs to prevent ArgoCD drift#69

Open
jsabalete wants to merge 1 commit intokyverno:mainfrom
jsabalete:fix/crd-conversion-strategy
Open

fix: add explicit conversion.strategy to CRDs to prevent ArgoCD drift#69
jsabalete wants to merge 1 commit intokyverno:mainfrom
jsabalete:fix/crd-conversion-strategy

Conversation

@jsabalete
Copy link

Problem

When deploying Kyverno via ArgoCD + Helm, CRDs remain permanently OutOfSync after upgrading to chart version 3.7.x.

Kubernetes automatically injects spec.conversion.strategy: None when a CRD is applied without a conversion field. Since the chart templates do not include this field, ArgoCD detects a permanent diff between the desired state (no conversion field) and the live state (conversion.strategy: None).

This is particularly problematic when using ApplicationSet with RollingSync, as the OutOfSync state on phase-0 (kyverno) blocks progressive deployment of all subsequent phases.

Fix

  • Added spec.conversion.strategy: None to all CRD templates in charts/kyverno-api/templates/crds/
  • Updated Makefile helm-chart target to inject the field during CRD generation

Affected CRDs

All 11 CRDs under policies.kyverno.io:

  • deletingpolicies, generatingpolicies, imagevalidatingpolicies, mutatingpolicies
  • namespaceddeletingpolicies, namespacedgeneratingpolicies, namespacedimagevalidatingpolicies, namespacedmutatingpolicies, namespacedvalidatingpolicies
  • policyexceptions, validatingpolicies

Verification

Compared helm-rendered CRD (desired) vs live cluster object (stripping runtime fields). The only structural diff was the missing spec.conversion field.

Fixes kyverno/kyverno#15116

@jsabalete jsabalete force-pushed the fix/crd-conversion-strategy branch from 62f96db to fa145d7 Compare March 20, 2026 12:32
Kubernetes automatically injects `spec.conversion.strategy: None` when
a CRD is applied without a conversion field. Since the chart templates
do not include this field, ArgoCD detects a permanent diff between the
desired state (no conversion field) and the live state (conversion.strategy: None),
causing the Application to remain OutOfSync indefinitely.

This is particularly problematic when using ApplicationSet with RollingSync,
as the OutOfSync state blocks progressive deployment of subsequent phases.

Fixes kyverno/kyverno#15116

Signed-off-by: Javi Sabalete <javi.sabalete@enverus.com>
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

Successfully merging this pull request may close these issues.

[Bug] Argo CD v3.3.0 + Kyverno Helm chart 3.7.0: CRDs remain OutOfSync after upgrade due to empty metadata maps

1 participant