mirror of
https://github.com/cozystack/cozystack.git
synced 2026-11-30 04:06:34 +09:00
Kamaji is built on the Kubernetes 1.37 libraries and renders the
tenant's kube-system/kubelet-config from 1.37 defaults. That output
carries fields the kubelet config API of an older tenant does not
have: memoryReservationPolicy (added in 1.36),
mergeDefaultEvictionSettings (1.33) and crashLoopBackOff (1.32).
Strict decoding on such a tenant fails, for example kubeadm join on
v1.35 logs:
strict decoding error: unknown field "memoryReservationPolicy"
kubeadm logs this as a warning and decodes leniently, dropping the
field, so the join succeeds, but any strict consumer of the ConfigMap
breaks.
Drop each field from the rendered object when the tenant version
predates it. The removal works on the encoded object because
crashLoopBackOff is a non-pointer struct: zeroing it still renders
"crashLoopBackOff: {}". A pre-release counts as older than its minor,
since the early alphas of a minor do not have its fields yet.
The patch ships a test for the rendered fields per tenant version,
run by the image build.
Assisted-by: LLM
Signed-off-by: Aleksei Sviridkin <f@lex.la>
(cherry picked from commit 932d1ac136)
Signed-off-by: cozystack-ci[bot] <274107086+cozystack-ci[bot]@users.noreply.github.com>