Skip to content

fix(rbac): grant Argo Rollouts permissions unconditionally - #540

Merged
mayankpande88 merged 4 commits into
mainfrom
fix/rollouts-rbac-unconditional
Jul 16, 2026
Merged

fix(rbac): grant Argo Rollouts permissions unconditionally#540
mayankpande88 merged 4 commits into
mainfrom
fix/rollouts-rbac-unconditional

Conversation

@mayankpande88

Copy link
Copy Markdown
Contributor

Problem

Rollouts RBAC in all three clusterrole templates was gated on .Capabilities.APIVersions.Has "argoproj.io/v1alpha1/Rollout", which only passes when the Rollout CRD exists at helm render time. Any cluster that installs Argo Rollouts after the agent chart (or installs via GitOps/templated manifests, where .Capabilities cannot see CRDs) never gets the grant until the next helm upgrade.

Observed in dev: kubewatch (forwarder) logged rollouts.argoproj.io is forbidden on every backoff, so Rollout UPDATE events never reached the trigger engine — no ConfigurationChange findings, no spec diffs for Rollouts, while Deployments worked fine.

Fix

Grant the argoproj.io/rollouts rules unconditionally in:

  • forwarder-service-account.yaml (get/list/watch)
  • runner-service-account.yaml (get/list/watch/patch/update; create/delete still behind runner.enableWritePermissions)
  • runner-service-account-readonly.yaml (get/list/watch)

This is the same pattern the karpenter block in these files already uses, with the same rationale: an RBAC rule for an absent CRD is inert and becomes active the moment the CRD is installed. Both kubewatch and the runner probe the CRD before watching, so the unconditional grant cannot stall anything.

Also updates the runner's stale comment/log in pkg/discovery/service.go that referenced the old render-time gating.

Verification

  • helm lint passes; helm template renders the rollouts rule in default and runner.readOnly=true modes.
  • Applied the equivalent RBAC to the dev cluster: kubewatch immediately started watching Rollouts, and bumping a Rollout's spec.replicas produced a ConfigurationChange finding with the expected side-by-side spec diff in the UI.

Rollouts RBAC was gated on .Capabilities.APIVersions.Has, which only
passes when the Rollout CRD exists at helm render time. Clusters that
install Argo Rollouts after the agent (or use GitOps/templated installs,
where .Capabilities cannot see CRDs) never got the grant, so kubewatch
could not watch Rollouts and no Rollout change events / spec diffs were
emitted until the next helm upgrade.

Grant the rules unconditionally instead — the same rationale already
applied to the karpenter block: an RBAC rule for an absent CRD is inert
and becomes active the moment the CRD is installed. Both kubewatch and
the runner probe the CRD before watching, so the grant is safe.

Also update the runner's stale comments/log that referenced the old
render-time gating.
@mayankpande88
mayankpande88 requested a review from a team as a code owner July 16, 2026 13:54

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Code Review

This pull request removes the conditional Helm capability checks for Argo Rollouts RBAC permissions, granting them unconditionally across the service accounts. This ensures that the RBAC rules are active immediately when Argo Rollouts is installed, without requiring a subsequent Helm upgrade. Additionally, the Go discovery service has been updated to reflect this change in its logging and comments. I have no feedback to provide as there are no review comments.

kubectl scale on a Rollout patches the rollouts/scale subresource, which
is a distinct RBAC resource — verbs on rollouts alone don't cover it, so
the runner's kubectl write path failed with Forbidden. Mirror the
existing deployments/scale treatment in the apps block.
@github-actions

Copy link
Copy Markdown
Contributor

📦 Image Tags Updated

I've automatically updated the image tags in `charts/nudgebee-agent/values.yaml` to the latest versions from GHCR for the `main` branch.

The image tags are now synchronized with the latest builds and ready for release.

The apps block grants delete on deployments/statefulsets/daemonsets/
replicasets unconditionally, but rollouts delete was gated behind
runner.enableWritePermissions — so delete_workload on a Rollout failed
on default installs while the same action on a Deployment worked.
Ungate delete; create stays gated like create for apps kinds.
@github-actions

Copy link
Copy Markdown
Contributor

📦 Image Tags Updated

I've automatically updated the image tags in `charts/nudgebee-agent/values.yaml` to the latest versions from GHCR for the `main` branch.

The image tags are now synchronized with the latest builds and ready for release.

@mayankpande88
mayankpande88 merged commit 14f6a1a into main Jul 16, 2026
7 checks passed
@mayankpande88
mayankpande88 deleted the fix/rollouts-rbac-unconditional branch July 16, 2026 14:07
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.

2 participants