Skip to content

Commit

Permalink
Set backend_not_found route status when any backends are not found (#…
Browse files Browse the repository at this point in the history
…12565)

The policy controller sets a status on HttpRoute resources depending on the state of the backends.  If all the backends can be resolved, it should set a resolved_ref status and if any of the backends cannot be resolved, it should set a backend_not_found status.

We update the logic to reflect this.  Additionally, this resolves the edge case where an empty list of backends was resulting in a backend_not_found status instead of a resolved_refs status.

Signed-off-by: Alex Leong <alex@buoyant.io>
  • Loading branch information
adleong committed May 10, 2024
1 parent 405aabb commit ad49cd1
Show file tree
Hide file tree
Showing 2 changed files with 333 additions and 14 deletions.
2 changes: 1 addition & 1 deletion policy-controller/k8s/status/src/index.rs
Expand Up @@ -421,7 +421,7 @@ impl Index {

// If all references have been resolved (i.e exist in our services cache),
// return positive status, otherwise, one of them does not exist
if backend_refs.iter().any(|backend_ref| match backend_ref {
if backend_refs.iter().all(|backend_ref| match backend_ref {
BackendReference::Service(service) => self.services.contains_key(service),
_ => false,
}) {
Expand Down

0 comments on commit ad49cd1

Please sign in to comment.