B #65: Fix Helm 4.0 compatibility for chart installation#66
Open
carloshm91 wants to merge 1 commit intoOpenNebula:masterfrom
Open
B #65: Fix Helm 4.0 compatibility for chart installation#66carloshm91 wants to merge 1 commit intoOpenNebula:masterfrom
carloshm91 wants to merge 1 commit intoOpenNebula:masterfrom
Conversation
Helm 4.0 uses Server-Side Apply (SSA) which enforces strict OpenAPI schema validation. This caused two installation failures: 1. CONTROL_PLANE_HOST null value rejected as non-string 2. remediationStrategy field rejected as undeclared in CRD schema
Contributor
|
Hi, thank you for taking the time to contribute! I believe we should include |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Fixes #65 — Helm chart installation fails with Helm 4.0 due to stricter Server-Side Apply (SSA) validation.
Two issues were found and fixed:
CONTROL_PLANE_HOSTrenders as YAMLnullfortype: stringCRD fields — WhenCONTROL_PLANE_HOSTis empty invalues.yaml(the default for non-VIP deployments), the generated chart template producesfloatingIP:(bare empty value), which YAML interprets asnull. Helm 3 was lenient about this, but Helm 4's SSA rejects it:remediationStrategyfield rejected as undeclared in RKE2ControlPlane CRD schema — Therke2cluster template includedremediationStrategy(withmaxRetryandretryPeriod), but this field was introduced incluster-api-provider-rke2v0.15.0. This project depends on v0.12.0, where the field does not exist in the CRD. Helm 3 silently ignored it with a warning; Helm 4 SSA rejects unknown fields:Changes
Makefile(line 196)| default ""convertsnilto an empty string explicitly| quotewraps the output in YAML double quotes, ensuring the empty string renders as""instead of bare empty (which YAML parses asnull)Both are needed because
kustomize buildstrips the original YAML quotes from the source templates during re-serialization (e.g.,"${CONTROL_PLANE_HOST}"becomes${CONTROL_PLANE_HOST}), soenvsubstproduces an unquoted Helm expression in the final chart template.kustomize/v1beta1/rke2/cluster-template.yamlRemoved the
remediationStrategyblock fromRKE2ControlPlanespec. This field does not exist in thecluster-api-provider-rke2v0.12.0 CRD that this project depends on (it was added in v0.15.0). The other RKE2 template variants (rke2-dev,rke2-vip,rke2-e2e) already did not include this field.api/v1beta1/zz_generated.deepcopy.goandconfig/crd/bases/infrastructure.cluster.x-k8s.io_oneclusters.yamlThese are auto-generated files regenerated by
controller-genduringmake build. They were outdated since PR #54 added theImageDatastoreId *uintpointer field toONEImagebut did not regenerate these artifacts. The changes are:ImageDatastoreId *uintpointer (allocates a newuintinstead of copying the pointer address)format: int32(the Go type is*uint, not*int32) and removesdefault: 1(no+kubebuilder:defaultmarker exists in the struct definition)Validation
Tested with real
helm install(not justhelm template) against a Kind cluster (Kubernetes v1.35.0) with all CRDs installed (CAPONE, CAPI v1.9.5, RKE2 v0.12.0):All 8 scenarios pass. The
floatingIPfield is stored as""(empty string) when unset, and as the provided IP when set — matching the expected behavior for the ONECluster controller.