Skip to content

[release-v1.42] Grant kube-controllers patch permission on tiers - #5360

Merged
caseydavenport merged 1 commit into
tigera:release-v1.42from
caseydavenport:casey-tier-patch-v142
Oct 20, 2026
Merged

caseydavenport merged 1 commit into
tigera:release-v1.42from
caseydavenport:casey-tier-patch-v142

Conversation

@caseydavenport

@caseydavenport caseydavenport commented Oct 20, 2026 •

Copy link
Copy Markdown
Member

Description

Bug fix, cherry-picked cleanly from PR 4972 (kube-controllers tier patch RBAC), which is already on master and release-v1.44.

Calico v3.32.2 shipped PR 13446 (tier finalizer patch backport), a backport of PR 13082 (tier finalizer via patch), so kube-controllers now adds its tier finalizer with a patch. Operator release-v1.42 pairs with Calico v3.32 and only grants create, update, get, list, and watch on tiers. On clusters using native projectcalico.org/v3 CRDs, kube-apiserver enforces that RBAC directly and rejects every patch:

failed to add finalizer: tiers.projectcalico.org "default" is forbidden: User "system:serviceaccount:calico-system:calico-kube-controllers" cannot patch resource "tiers"

Tiers never get the finalizer, so kube-controllers doesn't hold a tier's deletion until its policies are gone, and it logs that error continuously. We saw it on the nftables-talos native v3 CRD e2e lanes. Installs using the aggregated API server aren't affected.

This adds "patch" to the kube-controllers ClusterRole rule for tiers in both the projectcalico.org and crd.projectcalico.org groups, plus a render test asserting the rule. Only release-v1.42 needs the backport, since Calico v3.33 pairs with release-v1.44.

Tested with make ut UT_DIR=./pkg/render/kubecontrollers (43 of 43 specs pass).

AI assistance: Claude Code did the port and ran the tests. I reviewed it and am responsible for it.

Release Note

Related: CORE-13874

Fixes repeated "cannot patch resource tiers" errors from calico-kube-controllers on clusters using native projectcalico.org/v3 CRDs, so it can now add its finalizer to tiers.

For PR author

  • Tests for change.
  • If changing pkg/apis/, run make gen-files
  • If changing versions, run make gen-versions

For PR reviewers

A note for code reviewers - all pull requests must have the following:

  • Milestone set according to targeted release.
  • Appropriate labels:
    • kind/bug if this is a bugfix.
    • kind/enhancement if this is a a new feature.
    • enterprise if this PR applies to Calico Enterprise only.

The tier controller patches tiers to add and remove its finalizer.

(cherry picked from commit 0d39ca3)
@caseydavenport
caseydavenport requested a review from a team as a code owner October 20, 2026 13:52
@caseydavenport caseydavenport added this to the v1.42.7 milestone Oct 20, 2026
@caseydavenport
caseydavenport merged commit 4335af5 into tigera:release-v1.42 Oct 20, 2026
7 checks passed
@caseydavenport
caseydavenport deleted the casey-tier-patch-v142 branch October 20, 2026 15:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant