Skip to content

Commit f1f434d

Browse files
committed
Fix test and add release note
Signed-off-by: Rinka Yoshida <ryoshida@confluent.io>
1 parent cfb1c2a commit f1f434d

File tree

2 files changed

+24
-18
lines changed

2 files changed

+24
-18
lines changed

release-notes/current.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ new features: |
2525
Added support for custom headers on OTLP exports (metrics, tracing, access logs).
2626
Added support for configuring minimum response size for compression via minContentLength field in BackendTrafficPolicy.
2727
Added support for custom span name.
28+
Added support for configuring optional health check configuration.
2829
2930
bug fixes: |
3031
Fixed configured OIDC authorization endpoint being overridden by discovered endpoints from issuer's well-known URL.

test/e2e/tests/backend_health_check.go

Lines changed: 23 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ import (
1414
"time"
1515

1616
"github.com/stretchr/testify/require"
17+
corev1 "k8s.io/api/core/v1"
1718
"k8s.io/apimachinery/pkg/types"
1819
gwapiv1 "sigs.k8s.io/gateway-api/apis/v1"
1920
"sigs.k8s.io/gateway-api/conformance/utils/http"
@@ -151,32 +152,36 @@ var BackendHealthCheckWithOverrideTest = suite.ConformanceTest{
151152
Description: "Test backend health check with override configuration",
152153
Manifests: []string{"testdata/backend-health-check-with-override.yaml"},
153154
Test: func(t *testing.T, suite *suite.ConformanceTestSuite) {
154-
t.Run("health check with override", func(t *testing.T) {
155+
ns := "gateway-conformance-infra"
156+
withOverrideRouteNN := types.NamespacedName{Name: "httproute-with-health-check-override", Namespace: ns}
157+
withoutOverrideRouteNN := types.NamespacedName{Name: "httproute-without-health-check-override", Namespace: ns}
158+
gtwName := "same-namespace"
159+
gwNN := types.NamespacedName{Name: gtwName, Namespace: ns}
160+
gwAddr := kubernetes.GatewayAndHTTPRoutesMustBeAccepted(t, suite.Client, suite.TimeoutConfig, suite.ControllerName,
161+
kubernetes.NewGatewayRef(gwNN), withOverrideRouteNN, withoutOverrideRouteNN)
162+
163+
ancestorRef := gwapiv1.ParentReference{
164+
Group: gatewayapi.GroupPtr(gwapiv1.GroupName),
165+
Kind: gatewayapi.KindPtr(resource.KindGateway),
166+
Namespace: gatewayapi.NamespacePtr(gwNN.Namespace),
167+
Name: gwapiv1.ObjectName(gwNN.Name),
168+
}
169+
BackendTrafficPolicyMustBeAccepted(t, suite.Client, types.NamespacedName{Name: "btp-with-health-check-override", Namespace: ns}, suite.ControllerName, ancestorRef)
170+
BackendTrafficPolicyMustBeAccepted(t, suite.Client, types.NamespacedName{Name: "btp-without-health-check-override", Namespace: ns}, suite.ControllerName, ancestorRef)
171+
172+
// Wait for the service pods to be ready
173+
WaitForPods(t, suite.Client, ns, map[string]string{"app": "multi-ports-backend"}, corev1.PodRunning, &PodReady)
174+
WaitForPods(t, suite.Client, ns, map[string]string{"app": "single-port-backend"}, corev1.PodRunning, &PodReady)
175+
176+
t.Run("health checks work with and without health check overrides", func(t *testing.T) {
155177
ctx := context.Background()
156-
ns := "gateway-conformance-infra"
157-
withOverrideRouteNN := types.NamespacedName{Name: "httproute-with-health-check-override", Namespace: ns}
158-
withoutOverrideRouteNN := types.NamespacedName{Name: "httproute-without-health-check-override", Namespace: ns}
159-
gwNN := types.NamespacedName{Name: "same-namespace", Namespace: ns}
160-
gwAddr := kubernetes.GatewayAndHTTPRoutesMustBeAccepted(t, suite.Client, suite.TimeoutConfig, suite.ControllerName,
161-
kubernetes.NewGatewayRef(gwNN), withOverrideRouteNN, withoutOverrideRouteNN)
162-
163-
ancestorRef := gwapiv1.ParentReference{
164-
Group: gatewayapi.GroupPtr(gwapiv1.GroupName),
165-
Kind: gatewayapi.KindPtr(resource.KindGateway),
166-
Namespace: gatewayapi.NamespacePtr(gwNN.Namespace),
167-
Name: gwapiv1.ObjectName(gwNN.Name),
168-
}
169-
BackendTrafficPolicyMustBeAccepted(t, suite.Client, types.NamespacedName{Name: "btp-with-health-check-override", Namespace: ns}, suite.ControllerName, ancestorRef)
170-
BackendTrafficPolicyMustBeAccepted(t, suite.Client, types.NamespacedName{Name: "btp-without-health-check-override", Namespace: ns}, suite.ControllerName, ancestorRef)
171-
172178
promClient, err := prometheus.NewClient(suite.Client,
173179
types.NamespacedName{Name: "prometheus", Namespace: "monitoring"},
174180
)
175181
require.NoError(t, err)
176182

177183
withOverrideClusterName := fmt.Sprintf("httproute/%s/%s/rule/0", ns, withOverrideRouteNN.Name)
178184
withoutOverrideClusterName := fmt.Sprintf("httproute/%s/%s/rule/0", ns, withoutOverrideRouteNN.Name)
179-
gtwName := "same-namespace"
180185

181186
// both routes should have successful health checks
182187
withOverridePromQL := fmt.Sprintf(`envoy_cluster_health_check_success{envoy_cluster_name="%s",gateway_envoyproxy_io_owning_gateway_name="%s"}`, withOverrideClusterName, gtwName)

0 commit comments

Comments
 (0)