Conversation
…rt of the ACM-42568 effort Signed-off-by: Enrique Mingorance Cano <ginxaco@gmail.com>
This was referenced Sep 23, 2026
Closed
…6638 Signed-off-by: Enrique Mingorance Cano <ginxaco@gmail.com>
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.
📝 Summary
Backports ACM-44885 / #6638 to the Go
GET /eventspath as part of ACM-42568 / ACM-45223.Depends on: #6842 (
go/migration). This PR should merge intogo/migration, notmaindirectly.Type of Change: 🐞 Bug Fix
Problem
Restricted (non-admin) users could drive the console backend into high memory use and CPU saturation on large inventories. After cluster-scoped
listSSAR was denied, the Go hub fell through to O(N) per-object SelfSubjectAccessReviews (listnamespaced →get) for every cached resource in the SSE snapshot/live stream.Node fixed the same class of bug in stolostron#6638 with two ideas:
SelfSubjectRulesReviewper token+namespace, then localdeny-all/allow-all/allow-namesdecisions (with SSAR confirmation for cluster-scoped kinds).Only (1) is ported here. That is the change that bounds non-admin inventory filtering and prevents the OOM.
What changed (Go)
SSARAccess.canSee: clusterlistSSAR →SelfSubjectRulesReview→ local kind decision; SSARgetonly for incomplete fallback or cluster-scoped confirmation (RoleBinding indefaultcannot impersonateManagedClusteraccess).namespace+group+resource, per-token SSAR cap (2000), 60s TTL.WatchSpec.ClusterScoped: same cluster-scoped kinds as NodeCLUSTER_SCOPED_KINDS(ManagedCluster,Namespace,StorageClass, …). Scope is not inferred frommetadata.namespace.eventsAccess.test.ts(e.g. 500ManagedCluster→ 1 SSRR, 0 SSARget).backend/src/routes/events*.tsand tests) — not executed by the Go backend.backend/AGENTS.md,docs/ARCHITECTURE.md.Why no zlib resource cache or per-client inflate
The Node backend kept SSE resources in memory as dictionary-compressed zlib blobs (
deflateResource/inflateEvent). Each connected client could force decompression to full JSON before RBAC filtering (the pre-stolostron#6638 OOM path). stolostron#6638 added lightweightmetaand filter-before-inflate so denied events never expanded.The Go backend has a different architecture; those Node mechanisms are not needed for parity:
resourceCacheof zlibBuffersunstructuredcopy per resource, shared across clientsmetaor inflate to read identityEvent.Object/GVRwithout a decompress stepinflateEventper client before sendwriteFiltered→Allow→json.Marshalonly if allowed — denied events are never serialized to the wireinternal/events/hub/encode.go) — compression in transit, not in the event storeSo:
Test plan
go test ./...(hub SSRR tests including 500-cluster scale case)noneuser on Inventory — SSE completes, backend RSS/CPU stay bounded (noMOCK_CLUSTERSin Go; regression gate is unit tests above)✅ Checklist
General
ACM-12340 Fix bug with...)If Bugfix
🗒️ Notes for Reviewers
eventsAccess.tsfrom ACM-44885: Fix non-admin SSE OOM under large inventory stolostron/console#6638; cluster-scoped SSAR confirmation after non-deny-allSSRR is intentional.DELETEDevents remain unfiltered (bug-compat with Node; documented inbackend/AGENTS.md).