Skip to content

logstorage: stop deleting the tigera-linseed RoleBinding it no longer owns#5056

Open
hjiawei wants to merge 1 commit into
tigera:masterfrom
hjiawei:logstorage-keep-linseed-rolebinding
Open

logstorage: stop deleting the tigera-linseed RoleBinding it no longer owns#5056
hjiawei wants to merge 1 commit into
tigera:masterfrom
hjiawei:logstorage-keep-linseed-rolebinding

Conversation

@hjiawei

@hjiawei hjiawei commented Jul 16, 2026

Copy link
Copy Markdown
Contributor

Description

Bug fix for managed Enterprise clusters (EV-6837).

The managed-cluster logstorage cleanup still lists the tigera-linseed RoleBinding in calico-system in deprecatedObjects(), but that object is live again: the apiserver controller renders it for the MCM queryserver wiring (#4786) and the logcollector controller renders it since fluent-bit moved into calico-system (#4910), both so guardian's identity can manage Linseed token secrets there. The delete fought their create on every reconcile, so the RoleBinding flapped and guardian intermittently lost permission to provision Linseed tokens for calico-system components.

The entry was correct when it was added: the guardian RBAC consolidation (#3969, #4021) obsoleted logstorage's namespace-scoped bindings, and the cleanup removed the stragglers on upgrade. It just was never pruned when new controllers started rendering the same object again.

Found by a static audit of objects rendered by more than one controller (follow-up to #5055's tigera-ca-bundle fix — same root pattern: the component handler replaces object state wholesale, so two controllers with different desired state fight). The render test now pins the RoleBinding's absence from the delete list.

Release Note

None

No release note: both renders of this RoleBinding (#4786 and the fluent-bit migration #4910) are unreleased, so the create/delete fight never shipped.

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 PR fixes a bug

🤖 Generated with Claude Code

@hjiawei
hjiawei requested a review from a team as a code owner July 16, 2026 23:36
… owns

The managed-cluster cleanup still listed the tigera-linseed RoleBinding
in calico-system as deprecated, but the apiserver and logcollector
controllers render it again in managed clusters so guardian can manage
Linseed token secrets. The delete fought their create on every
reconcile, intermittently revoking guardian's token permissions.

Fixes EV-6837.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@hjiawei
hjiawei force-pushed the logstorage-keep-linseed-rolebinding branch from 16aae90 to 93ce48d Compare July 17, 2026 04:08
Comment thread pkg/render/logstorage.go
TypeMeta: metav1.TypeMeta{Kind: "ClusterRole", APIVersion: "rbac.authorization.k8s.io/v1"},
ObjectMeta: metav1.ObjectMeta{Name: "tigera-linseed-configmap"},
},
&rbacv1.RoleBinding{

@hjiawei hjiawei Jul 17, 2026

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Fixes a managed-cluster reconciliation conflict in the logstorage renderer by stopping logstorage from attempting to delete a RoleBinding/tigera-linseed in calico-system that is now actively rendered/owned by other controllers (so it no longer “fights” their desired state during reconcile).

Changes:

  • Removed RoleBinding/tigera-linseed (in calico-system) from the managed-cluster logstorage deprecatedObjects() delete list.
  • Updated the logstorage render test to ensure the RoleBinding is not expected in the delete set.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.

File Description
pkg/render/logstorage.go Drops RoleBinding/tigera-linseed in calico-system from managed-cluster deprecated cleanup to prevent reconcile flapping.
pkg/render/logstorage_test.go Updates expected delete resources to match the new cleanup behavior (RoleBinding no longer deleted).

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.

4 participants