Skip to content

fix: Report no healthy backends instead of an invalid rule - #1138

Merged
scotwells merged 3 commits into
mainfrom
fix/report-no-healthy-backends
Oct 27, 2026
Merged

scotwells merged 3 commits into
mainfrom
fix/report-no-healthy-backends

Conversation

@scotwells

@scotwells scotwells commented Oct 27, 2026 •

Copy link
Copy Markdown
Contributor

Summary

When health checks take every backend of a fail-closed service out of rotation, the gateway reported the rule as invalid, the same reason a malformed rule gets.

A load balancer whose only backend went down told its owner the configuration was broken.

The gateway now reports that no backend is healthy in that case, and other rule errors keep their reason.

Test plan

  • A fail-closed service with no healthy backend reports that reason and stops advertising its address
  • The service recovers once a backend reports healthy again
  • Unit tests pass

Related to datum-cloud/network-services-operator#722
Related to datum-cloud/network-services-operator#755
Related to datum-cloud/network-services-operator#718

A FailClosed rule whose every backend lacks a current Healthy probe result is
not loaded, and its per-node Programmed condition said InvalidRule. That
reason also covers malformed rules, so a tenant could not tell an outage of
their backends from a broken rule. NSO surfaces this reason on the network
load balancer's Ready condition, where it read as a configuration error.

Key changes:
- Add errNoHealthyBackends and map it to the NoHealthyBackends reason
- Assert the reason in the fail-closed build and gateway tests
The backend health doc said a gateway's Programmed condition stays True for
every health reason. A FailClosed rule with no healthy backend is now
reported False with NoHealthyBackends and its VIPs are withdrawn.

Key changes:
- Document the FailClosed case in the backend health status section
- Correct the backendProblemReasons comment, which said all are True
The fail-closed build test asserted errNoHealthyBackends for every case that
serves nothing. With health filtering disabled the rule fails because health
is unavailable, not because no backend is healthy, so it reports a different
error.

Key changes:
- Expect errNoHealthyBackends only when health filtering is applied
@scotwells
scotwells marked this pull request as ready for review October 27, 2026 17:18
@scotwells
scotwells requested a review from a team as a code owner October 27, 2026 17:18

@kevwilliams kevwilliams 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.

Verified backendSelectionError unwraps to errNoHealthyBackends so programmedCondition matches it, and the withdraw-and-recover test now asserts the NoHealthyBackends reason.

@scotwells
scotwells merged commit dbbc388 into main Oct 27, 2026
23 checks passed
@scotwells
scotwells deleted the fix/report-no-healthy-backends branch October 27, 2026 17:30
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