Skip to content

Fix: high-frequency retry loop on RBAC permission errors - #184

Closed
braghettos wants to merge 2 commits into
mainfrom
fix/rbac-retry-loop
Closed

Fix: high-frequency retry loop on RBAC permission errors#184
braghettos wants to merge 2 commits into
mainfrom
fix/rbac-retry-loop

Conversation

@braghettos

Copy link
Copy Markdown
Member

This PR fixes a high-frequency retry loop in the snowplow component.

The root cause of the issue was that the rbac.UserCan function did not differentiate between an API error during the SelfSubjectAccessReview and a definitive "permission denied" from the API server. It returned false in both cases. The calling code in internal/resolvers/widgets/resourcesrefs/resolve.go did not have a mechanism to handle the false return value as a potential error, leading to a high-frequency retry loop when the SelfSubjectAccessReview check itself was failing due to RBAC issues.

This PR addresses the issue by:

  • Modifying rbac.UserCan to return an error if the SelfSubjectAccessReview call fails.
  • Updating the calling code in internal/resolvers/widgets/resourcesrefs/resolve.go to handle the error from rbac.UserCan. If an error occurs, it is logged and the permission is set to false, preventing the retry loop.

Return an error from rbac.UserCan if the SelfSubjectAccessReviews
call fails. This allows the caller to distinguish between a
permission denied and an error during the check.
Handle the error returned from rbac.UserCan. If an error occurs,
log it and set the allowed status to false. This prevents the
retry loop caused by the inability to perform the
SelfSubjectAccessReview.
@braghettos braghettos closed this Apr 4, 2026
@braghettos
braghettos deleted the fix/rbac-retry-loop branch April 4, 2026 17:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant