Fix CNI plugin RBAC during manifest-to-operator migration#4514
Merged
caseydavenport merged 2 commits intotigera:masterfrom Mar 10, 2026
Merged
Conversation
During namespace migration, the calico-node ClusterRoleBinding correctly includes a kube-system subject so that unmigrated nodes retain access. The calico-cni-plugin ClusterRoleBinding was missing the same treatment, causing pod creation to fail on not-yet-migrated nodes with: "system:serviceaccount:kube-system:calico-cni-plugin" cannot get resource "clusterinformations" in API group "crd.projectcalico.org" Add AddBindingForKubeSystemCNIPlugin and call it from cniPluginRoleBinding when MigrateNamespaces is true, mirroring the existing calico-node logic.
tmjd
approved these changes
Mar 10, 2026
Member
tmjd
left a comment
There was a problem hiding this comment.
LGTM, I appreciate the comment on that new function. Thank you.
caseydavenport
added a commit
to caseydavenport/operator
that referenced
this pull request
Mar 10, 2026
caseydavenport
added a commit
to caseydavenport/operator
that referenced
this pull request
Mar 10, 2026
This was referenced Mar 10, 2026
caseydavenport
added a commit
to caseydavenport/operator
that referenced
this pull request
Mar 10, 2026
caseydavenport
added a commit
to caseydavenport/operator
that referenced
this pull request
Mar 10, 2026
This was referenced Mar 10, 2026
caseydavenport
added a commit
that referenced
this pull request
Mar 10, 2026
caseydavenport
added a commit
that referenced
this pull request
Mar 10, 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.
During manifest-to-operator namespace migration, the operator updates the
calico-cni-pluginClusterRoleBinding to referencecalico-system:calico-cni-plugin— but nodes that haven't been migrated yet still have the CNI plugin running askube-system:calico-cni-plugin. This means pod creation fails on those nodes with permission errors like:We already handle this correctly for the
calico-nodeCRB viaAddBindingForKubeSystemNode, which adds akube-system:calico-nodesubject during migration. Thecalico-cni-pluginCRB was just missing the same treatment.The fix adds
AddBindingForKubeSystemCNIPlugin(mirroring the existing node pattern) and calls it fromcniPluginRoleBinding()whenMigrateNamespacesis true.Related: CI-1949