Skip to content

fix(crds): remove allowEmptyValue to fix ArgoCD perpetual OutOfSync#481

Open
pierluigilenoci wants to merge 1 commit intolitmuschaos:masterfrom
pierluigilenoci:fix/crd-argocd-sync
Open

fix(crds): remove allowEmptyValue to fix ArgoCD perpetual OutOfSync#481
pierluigilenoci wants to merge 1 commit intolitmuschaos:masterfrom
pierluigilenoci:fix/crd-argocd-sync

Conversation

@pierluigilenoci
Copy link
Copy Markdown

Summary

Remove allowEmptyValue: false from all CRD schemas across 7 files in 6 charts.

Problem

allowEmptyValue is not a valid field in the OpenAPI v3 JSON Schema used by Kubernetes CRDs. When the CRD is applied, the K8s API server silently strips it. ArgoCD then detects a diff between the desired state (with the field) and the live state (without it), causing a perpetual OutOfSync status — even with ServerSideApply=true.

Fix

Remove all 11 occurrences of allowEmptyValue: false across all charts. The existing minLength: 1 constraints already enforce the same validation.

Affected charts:

Chart File Occurrences removed
litmus-core crds/chaosengine_crd.yaml 4
litmus-core crds/chaosexperiment_crd.yaml 7
litmus-agent templates/crds.yaml 11
kube-aws crds/chaosexperiment_crd.yaml 7
kube-azure crds/chaosexperiment_crd.yaml 7
kube-gcp crds/chaosexperiment_crd.yaml 7
kubernetes-chaos crds/chaosexperiment_crd.yaml 7

Closes #419

Test plan

  • grep -rn allowEmptyValue charts/ returns zero matches
  • ArgoCD no longer shows perpetual OutOfSync for chaosengines/chaosexperiments CRDs

@pierluigilenoci
Copy link
Copy Markdown
Author

@Jonsy13 @ispeakc0de this is ready for review.

Simple removal of an invalid OpenAPI field that the K8s API server strips, causing ArgoCD drift. No validation is lost since minLength: 1 is already present on all affected properties.

@pierluigilenoci
Copy link
Copy Markdown
Author

@ksatchit @Jasstkn @uditgaurav could you please review this when you get a chance? Thanks!

@PriteshKiri
Copy link
Copy Markdown

Hey @pierluigilenoci

Could you please resolve the conflicts?

Remove `allowEmptyValue: false` from all CRD schemas across all charts.

This field is not part of the OpenAPI v3 JSON Schema spec used by
Kubernetes CRDs. The API server silently strips it when the CRD is
applied, creating a perpetual diff between the desired state (with
the field) and the live state (without it). ArgoCD detects this diff
and reports the CRDs as OutOfSync indefinitely.

The existing `minLength: 1` constraints already enforce the same
validation, so removing `allowEmptyValue` does not reduce any
schema protection.

Affected charts: litmus-core, litmus-agent, kube-aws, kube-azure,
kube-gcp, kubernetes-chaos.

Fixes litmuschaos#419

Signed-off-by: Pierluigi Lenoci <pierluigi.lenoci@gmail.com>
@pierluigilenoci
Copy link
Copy Markdown
Author

Done — rebased on latest master, conflicts resolved. Ready for review!

@pierluigilenoci
Copy link
Copy Markdown
Author

Hi @PriteshKiri — I've verified the branch is already based on the latest master (5d7f1ca). Could you re-check the conflicts? It should be clean now. Let me know if anything else is needed!

@PriteshKiri
Copy link
Copy Markdown

@pierluigilenoci yes, conflicts are resolved now

@ispeakc0de will be reviewing it shortly.

@pierluigilenoci
Copy link
Copy Markdown
Author

Hi @ispeakc0de, @Jonsy13 -- friendly follow-up. @PriteshKiri confirmed on Mar 31 that conflicts are resolved and mentioned @ispeakc0de would review shortly. It's been about 10 days since then. CI is green and all checks pass. Would you be able to take a look? Thank you!

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.

Missing values in CRDs interferes with ArgoCD sync

2 participants