Skip to content

Conversation

@samridh10exe
Copy link

Fixes #151

Problem

Helm install fails with "got unexpected nil transformer" on Kubernetes 1.25+ due to empty status blocks in CRD templates. The empty acceptedNames.kind and acceptedNames.plural fields cause nil pointer errors during Helm's 3-way merge.

Solution

Removed explicit status blocks from all 27 CRD templates in charts/crds/templates/. Status fields are server-managed and should not be in templates. The Kubernetes API server generates them automatically after CRD validation.

Changes

  • Removed top-level status: blocks containing empty acceptedNames, conditions, and storedVersions
  • Preserved all spec.versions[].subresources.status: {} declarations (required for CRD functionality)
  • No other modifications to CRD specs, schemas, or metadata

Testing

Tested on Kubernetes v1.32 with Helm v3:

Installation

  • Fresh install: helm install sveltos-crds succeeds (previously failed)
  • Upgrade: helm upgrade sveltos-crds works correctly
  • Both charts tested: sveltos-crds and projectsveltos

Verification

  • All 28 CRDs created successfully
  • Status fields properly populated by API server (verified on accessrequests, clusterconfigurations, sveltosclusters, techsupports)
  • acceptedNames, conditions, and storedVersions auto-generated with correct values
  • Created and validated custom resource (Techsupport) - controller interaction confirmed

Backward Compatibility

  • Previous workaround (helm template | kubectl apply) still works
  • kubectl apply --dry-run=server validation unchanged
  • No regressions

The original error is resolved. Helm install now works without workarounds.

@gianlucam76
Copy link
Member

Thank you @samridh10exe for the PR (and sorry for the delay).

Can you please increase this to v1.2.2

then we can merge it. thank you so much again

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.

CRD installation via Helm fails on Kubernetes 1.25+

2 participants