Repository navigation
[release-v1.42] Default generated CNI config to cniVersion 1.0.0; add spec.cni.specVersion - #5125
Merged
caseydavenport merged 1 commit intoJul 30, 2026
Conversation
…rsion (tigera#5090) * Render CNI config with cniVersion 1.0.0 (was 0.3.1) The generated CNI config's cniVersion has been pinned to 0.3.1 since the early days for maximal backwards compatibility. OpenShift 4.23 bumps multus to a top-level cniVersion of 1.1.0, and multus rejects delegates below 0.4.0, crash-looping and leaving nodes NotReady (projectcalico/calico#12965, tigera#4969). Move the default to 1.0.0 for all platforms: - Every supported container runtime accepts 1.0.0 configs (containerd >= 1.6 / CRI-O >= 1.24). - Calico and its bundled chained plugins (portmap, bandwidth, tuning) have supported spec 1.0.0 for years; the calico KDD test lane runs it permanently. - Existing attachments are unaffected on upgrade: the runtime replays each attachment's original cniVersion at DEL. Validated on OpenShift 5.0.0-ec.3 (multus at 1.1.0: fixes the crash; install completes) and GA OpenShift 4.18 (multus at 0.4.0: no regression, hostPort/portmap verified) with stock Calico images. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> * Add spec.cni.specVersion to configure the generated CNI config version New optional field on the Installation CR controlling the "cniVersion" declared in the operator-generated CNI config. Auto (the default) lets the operator choose - currently 1.0.0 - and may be raised in future operator versions as older container runtimes fall out of support. Explicit values (0.3.1, 0.4.0, 1.0.0) pin the version for environments where a chained CNI plugin or container runtime requires one. 1.1.0 is deliberately not offered yet: the bundled third-party CNI plugins (portmap et al) top out at spec 1.0.0. The field is only valid with spec.cni.type: Calico, since that is the only mode in which the operator generates a CNI config. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> * Address review: clarify defaulting comment, add defaulting/validation tests - Simplify the fillDefaults comment on the CNI spec version. - defaults_test: assert specVersion defaults to Auto for Calico CNI and stays unset for other CNI plugins. - validation_test: split the specVersion test into explicit allow (Calico) and reject (non-Calico) cases. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> --------- Co-authored-by: Claude Fable 5 <noreply@anthropic.com> (cherry picked from commit fd37da0)
caseydavenport
approved these changes
Jul 30, 2026
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.
Cherry-pick of #5090 (fd37da0) to release-v1.42 (operator branch for Calico v3.32). Fixes Calico-on-OpenShift 4.23+ (#4969, projectcalico/calico#12965): multus requires the primary-CNI delegate config at cniVersion >= 0.4.0.
Conflict notes: test fixtures on this branch don't have the newer
InstallModefield (keptSpecVersiononly); dropped master-only netkit device_type render tests that were swept in as diff context.make gen-filesre-run on this branch — no drift.pkg/render,pkg/controller/installation(incl. CEL CRD tests via envtest), andpkg/controller/utilsall pass.Review flag for release owners: as on master, unset/
Autoresolves to 1.0.0 on all platforms, and this backport adds thespec.cni.specVersionfield to the Installation CRD in a patch release. If you'd prefer the more conservative z-stream shape (no CRD field, or Auto→1.0.0 only on OpenShift), say so and I'll adjust. The field does provide the 0.3.1 escape hatch that a bare default-change would lack.Upgrade safety: existing attachments replay their original cniVersion at DEL (runtime-cached config); all supported runtimes accept 1.0.0 (containerd >= 1.6 / CRI-O >= 1.24); validated live on GCP + GA OpenShift 4.18 upgrade paths and OpenShift 5.0.0-ec.3 (heals the multus crash).
Release note:
🤖 Generated with Claude Code