Tags: hasB4K/lws
Tags
fix(disaggregatedset): storage-promoter's CRD storage-flip must use J…
…SON Patch
CRITICAL DATA-LOSS BUG discovered end-to-end in the kind harness.
The Job previously flipped storage=v1 via merge-patch:
kubectl patch crd $CRD --type=merge -p '{
"spec": { "versions": [
{"name":"v1", ..., "schema":{"openAPIV3Schema":{"type":"object"}}},
{"name":"v1alpha1", ..., "schema":{"openAPIV3Schema":{"type":"object"}}}
]}
}'
JSON Merge Patch (RFC 7396) doesn't merge per-element on arrays — the
whole `spec.versions` array was REPLACED with what we sent. The stub
schemas above (`type: object`, no `properties`) then triggered
Kubernetes' structural-schema pruning to STRIP every field not
declared — nuking spec and status on every DisaggregatedSet on the
cluster.
Reproduced: right after the patch, `kubectl get --raw` on any DisaggSet
returns just apiVersion+kind+metadata; spec: null.
Rewrote using JSON Patch (RFC 6902) with test+replace targeting just
the .storage boolean on each version index:
[
{"op":"test", "path":"/spec/versions/N/name", "value":"v1"},
{"op":"replace","path":"/spec/versions/N/storage", "value":true},
{"op":"test", "path":"/spec/versions/M/name", "value":"v1alpha1"},
{"op":"replace","path":"/spec/versions/M/storage", "value":false}
]
Indexes N and M are looked up at runtime via jsonpath so the code
doesn't assume a fixed array order. The test ops guard the replaces —
if the array shape ever changes, the patch fails fast instead of
silently zeroing indexes.
Verified: kind harness runs green through Phase 07 with hasSpec:true
after EVERY phase; phase 07's annotate check that previously had to
warn+skip now passes cleanly.
Signed-off-by: Mathis Felardos <mathis@mistral.ai>
ci: use native Go cross-compilation for multi-arch build - Add --platform=$BUILDPLATFORM to Dockerfile to run builder natively - Remove QEMU emulation (not needed for Go cross-compilation) - Build for both amd64 and arm64 without slow emulation
ci: use native Go cross-compilation for multi-arch build - Add --platform=$BUILDPLATFORM to Dockerfile to run builder natively - Remove QEMU emulation (not needed for Go cross-compilation) - Build for both amd64 and arm64 without slow emulation
ci: use native Go cross-compilation for multi-arch build - Add --platform=$BUILDPLATFORM to Dockerfile to run builder natively - Remove QEMU emulation (not needed for Go cross-compilation) - Build for both amd64 and arm64 without slow emulation
ci: use native Go cross-compilation for multi-arch build - Add --platform=$BUILDPLATFORM to Dockerfile to run builder natively - Remove QEMU emulation (not needed for Go cross-compilation) - Build for both amd64 and arm64 without slow emulation
ci: use native Go cross-compilation for multi-arch build - Add --platform=$BUILDPLATFORM to Dockerfile to run builder natively - Remove QEMU emulation (not needed for Go cross-compilation) - Build for both amd64 and arm64 without slow emulation
Merge branch 'mistral-ai/disaggregatedset' into mistral-ai/disaggrega… …tedset-release
ci: use native Go cross-compilation for multi-arch build - Add --platform=$BUILDPLATFORM to Dockerfile to run builder natively - Remove QEMU emulation (not needed for Go cross-compilation) - Build for both amd64 and arm64 without slow emulation