Skip to content

NE-2422: Fix router e2e tests for dual-stack AWS clusters#30934

Merged
openshift-merge-bot[bot] merged 4 commits intoopenshift:mainfrom
alebedev87:ingress-dual-stack-fix-existing-tests
Mar 26, 2026
Merged

NE-2422: Fix router e2e tests for dual-stack AWS clusters#30934
openshift-merge-bot[bot] merged 4 commits intoopenshift:mainfrom
alebedev87:ingress-dual-stack-fix-existing-tests

Conversation

@alebedev87
Copy link
Contributor

@alebedev87 alebedev87 commented Mar 25, 2026

Several router e2e tests fail on dual-stack AWS clusters due to IPv4-only assumptions:

  • metrics: Disable proxy protocol when IPFamily is DualStack, since the installer forces NLB on AWS dual-stack which doesn't support proxy protocol.
  • h2spec: Add a v6only IPv6 bind line to the standalone test haproxy config on dual-stack clusters.
  • idle: Use TCP6-LISTEN for socat on IPv6-primary clusters so the readiness probe can connect via IPv6.
  • headers: Read the http echo server fixture and replace TCP4-LISTEN with TCP6-LISTEN on IPv6-primary clusters.

Example of a failed job: link

@openshift-ci-robot
Copy link

Pipeline controller notification
This repo is configured to use the pipeline controller. Second-stage tests will be triggered either automatically or after lgtm label is added, depending on the repository configuration. The pipeline controller will automatically detect which contexts are required and will utilize /test Prow commands to trigger the second stage.

For optional jobs, comment /test ? to see a list of all defined jobs. To trigger manually all jobs from second stage use /pipeline required command.

This repository is configured in: automatic mode

@openshift-ci-robot openshift-ci-robot added the jira/valid-reference Indicates that this PR references a valid Jira ticket of any type. label Mar 25, 2026
@openshift-ci-robot
Copy link

openshift-ci-robot commented Mar 25, 2026

@alebedev87: This pull request references NE-2422 which is a valid jira issue.

Warning: The referenced jira issue has an invalid target version for the target branch this PR targets: expected the story to target the "4.22.0" version, but no target version was set.

Details

In response to this:

Several router e2e tests fail on dual-stack AWS clusters due to IPv4-only assumptions:

  • metrics: Disable proxy protocol when IPFamily is DualStack, since the installer forces NLB on AWS dual-stack which doesn't support proxy protocol.
  • h2spec: Add a v6only IPv6 bind line to the standalone test haproxy config on dual-stack clusters.
  • idle: Use TCP6-LISTEN for socat on IPv6-primary clusters so the readiness probe can connect via IPv6.
  • headers: Read the http echo server fixture and replace TCP4-LISTEN with TCP6-LISTEN on IPv6-primary clusters.

Example of failed job: link

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the openshift-eng/jira-lifecycle-plugin repository.

@coderabbitai
Copy link

coderabbitai bot commented Mar 25, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 3a918abd-d57d-4163-9e28-780328cb4f71

📥 Commits

Reviewing files that changed from the base of the PR and between 18acff2 and 4fe4482.

📒 Files selected for processing (4)
  • test/extended/router/h2spec.go
  • test/extended/router/headers.go
  • test/extended/router/idle.go
  • test/extended/router/metrics.go
✅ Files skipped from review due to trivial changes (2)
  • test/extended/router/headers.go
  • test/extended/router/h2spec.go
🚧 Files skipped from review as they are similar to previous changes (2)
  • test/extended/router/idle.go
  • test/extended/router/metrics.go

Walkthrough

Tests updated to detect AWS dual-stack IP family and adapt router test behavior: conditional HAProxy IPv6 bind, switching socat/listener to TCP6, in-memory config edits before applying, and disabling proxy protocol for dual-stack AWS clusters.

Changes

Cohort / File(s) Summary
Router tests — AWS dual‑stack detection & behavior
test/extended/router/h2spec.go, test/extended/router/headers.go, test/extended/router/idle.go, test/extended/router/metrics.go
Added detection of infra.Status.PlatformStatus.AWS.IPFamily for dual‑stack variants. Changes: set a dualStackIPFamily flag; append IPv6 bind :::8443 ... v6only in HAProxy when dual‑stack; read and modify router echo config in‑memory replacing TCP4-LISTENTCP6-LISTEN before oc create -f -; switch socat listener to TCP6-LISTEN when IPv6‑primary; disable proxy protocol for dual‑stack AWS.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Warning

There were issues while running some tools. Please review the errors and either fix the tool's configuration or disable the tool if it's a critical failure.

🔧 golangci-lint (2.11.4)

Error: can't load config: unsupported version of the configuration: "" See https://golangci-lint.run/docs/product/migration-guide for migration instructions
The command is terminated due to an error: can't load config: unsupported version of the configuration: "" See https://golangci-lint.run/docs/product/migration-guide for migration instructions


Comment @coderabbitai help to get the list of available commands and usage tips.

@openshift-ci openshift-ci bot requested review from bentito and rfredette March 25, 2026 23:27
@openshift-ci openshift-ci bot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Mar 25, 2026
@openshift-ci-robot
Copy link

openshift-ci-robot commented Mar 25, 2026

@alebedev87: This pull request references NE-2422 which is a valid jira issue.

Warning: The referenced jira issue has an invalid target version for the target branch this PR targets: expected the story to target the "4.22.0" version, but no target version was set.

Details

In response to this:

Several router e2e tests fail on dual-stack AWS clusters due to IPv4-only assumptions:

  • metrics: Disable proxy protocol when IPFamily is DualStack, since the installer forces NLB on AWS dual-stack which doesn't support proxy protocol.
  • h2spec: Add a v6only IPv6 bind line to the standalone test haproxy config on dual-stack clusters.
  • idle: Use TCP6-LISTEN for socat on IPv6-primary clusters so the readiness probe can connect via IPv6.
  • headers: Read the http echo server fixture and replace TCP4-LISTEN with TCP6-LISTEN on IPv6-primary clusters.

Example of failed job: link

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the openshift-eng/jira-lifecycle-plugin repository.

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🧹 Nitpick comments (2)
test/extended/router/headers.go (1)

87-95: Fail fast if the fixture rewrite stops matching.

Line 93's ReplaceAll becomes a silent no-op if test/extended/testdata/router/router-http-echo-server.yaml stops containing the expected TCP4-LISTEN stanza, so the test can drift back to the old behavior without a clear signal. Checking the match count and replacing once makes that failure mode obvious.

♻️ Example hardening
 			configData, err := os.ReadFile(configPath)
 			o.Expect(err).NotTo(o.HaveOccurred())
 			config := string(configData)
 			// On IPv6-primary clusters, socat must listen on IPv6.
 			if dualStackIPv6Primary {
+				o.Expect(strings.Count(config, "TCP4-LISTEN")).To(o.Equal(1), "expected a single TCP4-LISTEN stanza in fixture")
 				g.By("with IPv6 listen")
-				config = strings.ReplaceAll(config, "TCP4-LISTEN", "TCP6-LISTEN")
+				config = strings.Replace(config, "TCP4-LISTEN", "TCP6-LISTEN", 1)
 			}
 			err = oc.Run("create").Args("-f", "-").InputString(config).Execute()
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@test/extended/router/headers.go` around lines 87 - 95, The current rewrite
using strings.ReplaceAll on the config string (see variable config and the
dualStackIPv6Primary branch) silently does nothing if "TCP4-LISTEN" is not
present; modify this to detect and fail fast by checking the match count or
using strings.Replace with a count of 1 and asserting that a replacement
occurred: compute occurrences := strings.Count(config, "TCP4-LISTEN"); if
occurrences == 0 { o.Expect(fmt.Errorf("expected TCP4-LISTEN stanza not
found")).NotTo(o.HaveOccurred()) } else { config = strings.Replace(config,
"TCP4-LISTEN", "TCP6-LISTEN", 1) } so the test fails loudly if the fixture no
longer matches and only one replacement is performed.
test/extended/router/metrics.go (1)

55-67: Centralize the AWS IP-family lookup.

This same PlatformStatus.AWS.IPFamily plumbing now exists in test/extended/router/h2spec.go, test/extended/router/idle.go, and test/extended/router/headers.go too, and the call sites already diverge a bit on nil-handling. A small helper in package router that returns the AWS IP family would keep the “any dual-stack” and “IPv6-primary only” callers explicit without repeating the infrastructure parsing.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@test/extended/router/metrics.go` around lines 55 - 67, Centralize the
repeated AWS IPFamily extraction by adding a small helper in package router
(e.g., func GetAWSIPFamily(infra *configv1.Infrastructure) (*configv1.IPFamily,
bool)) that safely handles nil PlatformStatus/AWS and returns the IPFamily plus
a presence flag; then replace the inline plumbing in metrics.go (the
dualStackIPFamily calculation and use in proxyProtocol) and the similar code in
test/extended/router/h2spec.go, idle.go, and headers.go to call GetAWSIPFamily
and base dual-stack and IPv6-primary checks on its result instead of duplicating
nil checks.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Nitpick comments:
In `@test/extended/router/headers.go`:
- Around line 87-95: The current rewrite using strings.ReplaceAll on the config
string (see variable config and the dualStackIPv6Primary branch) silently does
nothing if "TCP4-LISTEN" is not present; modify this to detect and fail fast by
checking the match count or using strings.Replace with a count of 1 and
asserting that a replacement occurred: compute occurrences :=
strings.Count(config, "TCP4-LISTEN"); if occurrences == 0 {
o.Expect(fmt.Errorf("expected TCP4-LISTEN stanza not
found")).NotTo(o.HaveOccurred()) } else { config = strings.Replace(config,
"TCP4-LISTEN", "TCP6-LISTEN", 1) } so the test fails loudly if the fixture no
longer matches and only one replacement is performed.

In `@test/extended/router/metrics.go`:
- Around line 55-67: Centralize the repeated AWS IPFamily extraction by adding a
small helper in package router (e.g., func GetAWSIPFamily(infra
*configv1.Infrastructure) (*configv1.IPFamily, bool)) that safely handles nil
PlatformStatus/AWS and returns the IPFamily plus a presence flag; then replace
the inline plumbing in metrics.go (the dualStackIPFamily calculation and use in
proxyProtocol) and the similar code in test/extended/router/h2spec.go, idle.go,
and headers.go to call GetAWSIPFamily and base dual-stack and IPv6-primary
checks on its result instead of duplicating nil checks.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 0483dd68-3840-4784-84a0-d2fdc8a75c26

📥 Commits

Reviewing files that changed from the base of the PR and between ca9ab3a and 18acff2.

📒 Files selected for processing (4)
  • test/extended/router/h2spec.go
  • test/extended/router/headers.go
  • test/extended/router/idle.go
  • test/extended/router/metrics.go

@alebedev87
Copy link
Contributor Author

/test lint

@alebedev87
Copy link
Contributor Author

/test go-verify-deps

@openshift-ci-robot
Copy link

Scheduling required tests:
/test e2e-aws-csi
/test e2e-aws-ovn-fips
/test e2e-aws-ovn-microshift
/test e2e-aws-ovn-microshift-serial
/test e2e-aws-ovn-serial-1of2
/test e2e-aws-ovn-serial-2of2
/test e2e-gcp-csi
/test e2e-gcp-ovn
/test e2e-gcp-ovn-upgrade
/test e2e-metal-ipi-ovn-ipv6
/test e2e-vsphere-ovn
/test e2e-vsphere-ovn-upi

@lihongan
Copy link
Contributor

/testwith openshift/installer/main/e2e-aws-ovn-dualstack-ipv6-primary-techpreview openshift/cloud-provider-aws#135 openshift/installer#10380 openshift/cluster-kube-apiserver-operator#2079 openshift/cluster-ingress-operator#1376

@alebedev87
Copy link
Contributor Author

alebedev87 commented Mar 26, 2026

Tests which were adopted in this PR passed (log file):

passed: (3m21s) 2026-03-26T06:41:18 "[sig-network-edge][Conformance][Area:Networking][Feature:Router][apigroup:route.openshift.io] The HAProxy router should pass the h2spec conformance tests [apigroup:authorization.openshift.io][apigroup:user.openshift.io][apigroup:security.openshift.io][apigroup:operator.openshift.io] [Suite:openshift/conformance/parallel/minimal]"

passed: (24s) 2026-03-26T06:20:08 "[sig-network][Feature:Router][apigroup:operator.openshift.io] The HAProxy router should set Forwarded headers appropriately [Suite:openshift/conformance/parallel]"

passed: (25.2s) 2026-03-26T06:42:27 "[sig-network-edge][Conformance][Area:Networking][Feature:Router] The HAProxy router should be able to connect to a service that is idled because a GET on the route will unidle it [Suite:openshift/conformance/parallel/minimal]"

passed: (45.9s) 2026-03-26T06:22:20 "[sig-network][Feature:Router] The HAProxy router should expose prometheus metrics for a route [apigroup:route.openshift.io] [Suite:openshift/conformance/parallel]"

@lihongan
Copy link
Contributor

/verified by CI

@openshift-ci-robot openshift-ci-robot added the verified Signifies that the PR passed pre-merge verification criteria label Mar 26, 2026
@openshift-ci-robot
Copy link

@lihongan: This PR has been marked as verified by CI.

Details

In response to this:

/verified by CI

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the openshift-eng/jira-lifecycle-plugin repository.

@openshift-ci-robot
Copy link

openshift-ci-robot commented Mar 26, 2026

@alebedev87: This pull request references NE-2422 which is a valid jira issue.

Warning: The referenced jira issue has an invalid target version for the target branch this PR targets: expected the story to target the "4.22.0" version, but no target version was set.

Details

In response to this:

Several router e2e tests fail on dual-stack AWS clusters due to IPv4-only assumptions:

  • metrics: Disable proxy protocol when IPFamily is DualStack, since the installer forces NLB on AWS dual-stack which doesn't support proxy protocol.
  • h2spec: Add a v6only IPv6 bind line to the standalone test haproxy config on dual-stack clusters.
  • idle: Use TCP6-LISTEN for socat on IPv6-primary clusters so the readiness probe can connect via IPv6.
  • headers: Read the http echo server fixture and replace TCP4-LISTEN with TCP6-LISTEN on IPv6-primary clusters.

Example of a failed job: link

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the openshift-eng/jira-lifecycle-plugin repository.

Copy link

@davidesalerno davidesalerno left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The code seems to be ok, just a couple of observations (severity is very low)

alebedev87 and others added 4 commits March 26, 2026 12:35
…usters

Dual-stack installations on AWS are forced to use NLB by the installer,
which doesn't support proxy protocol. Skip proxy protocol when the
infrastructure IPFamily is DualStackIPv4Primary or DualStackIPv6Primary.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
…al-stack

The h2spec test deploys a standalone haproxy pod as a backend to verify
HTTP/2 conformance. On dual-stack clusters, this test haproxy needs a
separate IPv6 bind with v6only to listen on both address families.
Add the extra bind line when the infrastructure IPFamily is one of the
DualStack values.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
On IPv6-primary dual-stack clusters, the readiness probe connects via
the pod's IPv6 address. The socat backend using TCP4-LISTEN only accepts
IPv4 connections, causing the pod to never become ready and the test to
time out. Use TCP6-LISTEN when the infrastructure IPFamily is
DualStackIPv6Primary.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
…usters

The headers test deploys a standalone http echo server pod using socat
with TCP4-LISTEN. On IPv6-primary clusters, connections arrive over IPv6
so the pod never responds. Read the fixture, replace TCP4-LISTEN with
TCP6-LISTEN when the infrastructure IPFamily is DualStackIPv6Primary,
and feed the modified config via stdin.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@alebedev87 alebedev87 force-pushed the ingress-dual-stack-fix-existing-tests branch from 18acff2 to 4fe4482 Compare March 26, 2026 11:36
@openshift-ci-robot openshift-ci-robot removed the verified Signifies that the PR passed pre-merge verification criteria label Mar 26, 2026
@alebedev87
Copy link
Contributor Author

Re-adding the verified label because the addressed review must not affect the test run.

/verified by CI

@openshift-ci-robot openshift-ci-robot added the verified Signifies that the PR passed pre-merge verification criteria label Mar 26, 2026
@openshift-ci-robot
Copy link

@alebedev87: This PR has been marked as verified by CI.

Details

In response to this:

Re-adding the verified label because the addressed review must not affect the test run.

/verified by CI

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the openshift-eng/jira-lifecycle-plugin repository.

@openshift-ci-robot
Copy link

Scheduling required tests:
/test e2e-aws-csi
/test e2e-aws-ovn-fips
/test e2e-aws-ovn-microshift
/test e2e-aws-ovn-microshift-serial
/test e2e-aws-ovn-serial-1of2
/test e2e-aws-ovn-serial-2of2
/test e2e-gcp-csi
/test e2e-gcp-ovn
/test e2e-gcp-ovn-upgrade
/test e2e-metal-ipi-ovn-ipv6
/test e2e-vsphere-ovn
/test e2e-vsphere-ovn-upi

@davidesalerno
Copy link

/approve
/lgtm

@openshift-ci openshift-ci bot added the lgtm Indicates that a PR is ready to be merged. label Mar 26, 2026
@openshift-ci
Copy link
Contributor

openshift-ci bot commented Mar 26, 2026

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: alebedev87, davidesalerno

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@openshift-ci
Copy link
Contributor

openshift-ci bot commented Mar 26, 2026

@alebedev87: all tests passed!

Full PR test history. Your PR dashboard.

Details

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. I understand the commands that are listed here.

@openshift-merge-bot openshift-merge-bot bot merged commit 46a9f6e into openshift:main Mar 26, 2026
21 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

approved Indicates a PR has been approved by an approver from all required OWNERS files. jira/valid-reference Indicates that this PR references a valid Jira ticket of any type. lgtm Indicates that a PR is ready to be merged. verified Signifies that the PR passed pre-merge verification criteria

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants