Skip to content

fix: pass cluster K8s version to Helm SDK chart rendering#197

Merged
mchmarny merged 1 commit intomainfrom
fix/helm-render-kubeversion
Feb 24, 2026
Merged

fix: pass cluster K8s version to Helm SDK chart rendering#197
mchmarny merged 1 commit intomainfrom
fix/helm-render-kubeversion

Conversation

@mchmarny
Copy link
Member

Summary

  • Extract K8s server version from snapshot and pass to Helm SDK's install.KubeVersion during chart rendering
  • Fixes chart requires kubeVersion: >= X which is incompatible with Kubernetes v1.20.0 errors in validation

Root cause

PR #186 replaced the helm CLI subprocess with the Helm Go SDK for chart rendering. In client-only mode, the SDK copies chartutil.DefaultCapabilities which hardcodes k8sVersionMajor=1, k8sVersionMinor=20 (Kubernetes v1.20.0). The install.KubeVersion override was never set, so charts with kubeVersion constraints (cert-manager, network-operator, skyhook-operator, etc.) fail rendering.

Fix

  • Add kubeVersion parameter to resolveExpectedResources() and renderHelmTemplate()
  • New kubeVersionFromSnapshot() helper extracts the version from the K8s server subtype
  • Set install.KubeVersion via chartutil.ParseKubeVersion() before RunWithContext()
  • When no snapshot is available (tests), empty string preserves existing default behavior

Test plan

  • go test -race ./pkg/validator/... — all tests pass
  • make test — full suite passes
  • make lint — 0 issues
  • CI GPU Inference Test should now render all charts successfully

The Helm Go SDK defaults to Kubernetes v1.20.0 in client-only mode
(chartutil.DefaultCapabilities). Charts with kubeVersion constraints
(cert-manager >= 1.22, skyhook-operator >= 1.30, etc.) fail rendering
because the SDK never learns the actual cluster version.

Extract the K8s server version from the snapshot and pass it via
install.KubeVersion so the SDK uses the real cluster version for
constraint evaluation.
@mchmarny mchmarny requested a review from a team as a code owner February 24, 2026 00:26
@mchmarny mchmarny enabled auto-merge (squash) February 24, 2026 00:28
@mchmarny mchmarny merged commit 4637a80 into main Feb 24, 2026
16 checks passed
@mchmarny mchmarny deleted the fix/helm-render-kubeversion branch February 24, 2026 00:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants