Skip to content

fix(runner/triggers): treat Forbidden as 'no rollouts' in service_no_endpoints workload sweep - #539

Merged
mayankpande88 merged 7 commits into
mainfrom
fix/service-no-endpoints-forbidden
Jul 20, 2026
Merged

fix(runner/triggers): treat Forbidden as 'no rollouts' in service_no_endpoints workload sweep#539
mayankpande88 merged 7 commits into
mainfrom
fix/service-no-endpoints-forbidden

Conversation

@mayankpande88

Copy link
Copy Markdown
Contributor

Problem

On clusters without the Argo Rollouts CRD, service_no_endpoints never fires. Found during live verification on the dev cluster: the selector-mismatch repro produced zero findings despite kubewatch delivering the Service update.

Root cause: the chart only grants rollouts RBAC when the CRD exists at install time, and the apiserver's authorizer rejects the request before checking resource existence — so CRD-less clusters return 403 Forbidden, not 404 NotFound. The rollouts sweep propagated the 403 as an error, and the predicate's fail-open (never alert on missing data) suppressed every finding.

Fix

Treat Forbidden like NotFound in the rollouts sweep: best-effort, counts as "no rollouts". The typed sweeps (Deployments/StatefulSets/DaemonSets) already succeeded at that point; only genuinely unexpected errors still fail open.

Verification

  • Reproduced live on the dev cluster (agent image 6d1cadc): Service selector patched to a dead label → endpoints gone → no finding, alerts_forwarded_total 0, runner boot log shows the same 403 on its rollout discovery probe.
  • Unit tests pass; will re-verify on dev after this image rolls out.

@mayankpande88
mayankpande88 requested a review from a team as a code owner July 15, 2026 18:07

@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 updates the service backends lister to treat both NotFound and Forbidden errors as "no rollouts" when querying Argo Rollouts, preventing workload probe failures on clusters without Argo or proper RBAC. The reviewer suggests caching this "unsupported" status after the first failure to avoid repeated API calls that could overload the API server and flood audit logs with 403/404 errors.

Comment thread runner/cmd/agent/service_backends_lister.go
@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.

1 similar comment
@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.

hsundar-git
hsundar-git previously approved these changes Jul 15, 2026
@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.

Clusters without the Argo CRD return 403 (RBAC denies before resource
existence is checked; the chart gates rollouts RBAC on the CRD existing
at install time), not 404. Propagating it as an error made the
predicate fail open and suppressed every service_no_endpoints finding
on CRD-less clusters — observed live on the dev cluster.
…04 probes

Once the rollouts API returns NotFound/Forbidden, remember it so
CRD-less clusters don't take a guaranteed failing round-trip (and
audit-log entry) on every service check. CRD installed later needs an
agent restart — same trade-off the chart makes gating rollouts RBAC on
the CRD existing at install time.
…s evidence

The investigate page renders per-block insights; the collector's only
sources are Warning rows in event tables (a zero-endpoint Service emits
no K8s events) and pod-status extraction from the raw-event json (the
subject is a Service), so these findings surfaced with an empty
Insights section. Ship the insight explicitly via additional_info
.insights, which the collector passes through verbatim.
@mayankpande88
mayankpande88 force-pushed the fix/service-no-endpoints-forbidden branch from 7c9e971 to 3050f2e Compare July 16, 2026 10:58
@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.

@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 01e8d7e into main Jul 20, 2026
7 checks passed
@mayankpande88
mayankpande88 deleted the fix/service-no-endpoints-forbidden branch July 20, 2026 10:29
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.

3 participants