Skip to content

Commit 4fe4482

Browse files
alebedev87claude
andcommitted
NE-2422: router/headers: use TCP6-LISTEN for socat on IPv6-primary clusters
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>
1 parent 76c4f47 commit 4fe4482

1 file changed

Lines changed: 14 additions & 1 deletion

File tree

test/extended/router/headers.go

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ import (
66
"fmt"
77
"net"
88
"net/http"
9+
"os"
910
"strings"
1011
"time"
1112

@@ -54,8 +55,12 @@ var _ = g.Describe("[sig-network][Feature:Router][apigroup:operator.openshift.io
5455
o.Expect(network).NotTo(o.BeNil())
5556

5657
platformType := infra.Status.Platform
58+
dualStackIPv6Primary := false
5759
if infra.Status.PlatformStatus != nil {
5860
platformType = infra.Status.PlatformStatus.Type
61+
if infra.Status.PlatformStatus.AWS != nil {
62+
dualStackIPv6Primary = infra.Status.PlatformStatus.AWS.IPFamily == configv1.DualStackIPv6Primary
63+
}
5964
}
6065
switch platformType {
6166
case configv1.AWSPlatformType, configv1.AzurePlatformType, configv1.GCPPlatformType:
@@ -79,7 +84,15 @@ var _ = g.Describe("[sig-network][Feature:Router][apigroup:operator.openshift.io
7984

8085
g.By(fmt.Sprintf("creating an http echo server from a config file %q", configPath))
8186

82-
err := oc.Run("create").Args("-f", configPath).Execute()
87+
configData, err := os.ReadFile(configPath)
88+
o.Expect(err).NotTo(o.HaveOccurred())
89+
config := string(configData)
90+
// On IPv6-primary clusters, socat must listen on IPv6.
91+
if dualStackIPv6Primary {
92+
g.By("with IPv6 listen")
93+
config = strings.ReplaceAll(config, "TCP4-LISTEN", "TCP6-LISTEN")
94+
}
95+
err = oc.Run("create").Args("-f", "-").InputString(config).Execute()
8396
o.Expect(err).NotTo(o.HaveOccurred())
8497

8598
var clientIP string

0 commit comments

Comments
 (0)