fix: parent-child httpproxy health checking (#25714)

Signed-off-by: Greg Barasch <gregbarasch@gmail.com>
This commit is contained in:
Greg Barasch 2026-02-21 09:16:33 -05:00 committed by GitHub
parent b85887fc3a
commit 401b1a8b3c
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 36 additions and 1 deletions

View file

@ -15,6 +15,9 @@ if obj.status then
hs.status = "Healthy"
hs.message = obj.status.description
return hs
elseif obj.spec.includes ~= nil and cond.status == "False" then
hs.status = "Healthy"
hs.message = "HTTPProxy inclusions cannot be health checked" -- Parent/child pairs depend on each other circularly. This means that, without this check here, we block deployments. Either we flag orphans as valid/unknown, risking a successful deploy followed by subsequent failures once adopted, or we mark proxies with inclusions (parents) as healthy.
elseif cond.type == "Valid" and cond.status == "False" then
hs.status = "Degraded"
hs.message = obj.status.description

View file

@ -18,4 +18,8 @@ tests:
- healthStatus:
status: Progressing
message: 'Waiting for status'
inputPath: testdata/generation.yaml
inputPath: testdata/generation.yaml
- healthStatus:
status: Healthy
message: 'HTTPProxy inclusions cannot be health checked'
inputPath: testdata/parent_child.yaml

View file

@ -0,0 +1,28 @@
apiVersion: projectcontour.io/v1
kind: HTTPProxy
metadata:
generation: 1
name: basic
spec:
virtualhost:
fqdn: foo-basic.bar.com
includes:
- name: unimportant
status:
conditions:
- errors:
- message: include unimportant not found
reason: IncludeNotFound
status: "True"
type: IncludeError
type: Valid
status: "False"
observedGeneration: 1
lastTransitionTime: "2025-04-07T10:00:00Z"
reason: ErrorPresent
message: At least one error present, see Errors for details
currentStatus: invalid
description: At least one error present, see Errors for details
loadBalancer:
ingress:
- hostname: www.example.com