You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@apisix.apache.org by ni...@apache.org on 2026/08/12 09:19:11 UTC
(apisix-ingress-controller) branch master updated: fix: stop the status e2e tests demanding their old node ports back (#2845)
This is an automated email from the ASF dual-hosted git repository.
nic-6443 pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/apisix-ingress-controller.git
The following commit(s) were added to refs/heads/master by this push:
new e1ea081c fix: stop the status e2e tests demanding their old node ports back (#2845)
e1ea081c is described below
commit e1ea081c46b2785b29452fadce958777c34d7502
Author: Nic <qi...@api7.ai>
AuthorDate: Wed Aug 12 17:19:06 2026 +0800
fix: stop the status e2e tests demanding their old node ports back (#2845)
---
test/e2e/crds/v2/status.go | 6 ++++++
test/e2e/gatewayapi/status.go | 6 ++++++
2 files changed, 12 insertions(+)
diff --git a/test/e2e/crds/v2/status.go b/test/e2e/crds/v2/status.go
index 55f94de1..eaccb601 100644
--- a/test/e2e/crds/v2/status.go
+++ b/test/e2e/crds/v2/status.go
@@ -187,6 +187,12 @@ spec:
Expect(err).NotTo(HaveOccurred(), "getting service yaml")
err = yaml.Unmarshal([]byte(serviceYaml), &k8sservice)
Expect(err).NotTo(HaveOccurred(), "unmarshalling service")
+ // Switching to ExternalName released the allocated node ports, and a service
+ // in a parallel test namespace may have taken them since. Ask for fresh ones
+ // instead of the old numbers, which would fail with "already allocated".
+ for i := range oldSpec.Ports {
+ oldSpec.Ports[i].NodePort = 0
+ }
k8sservice.Spec = oldSpec
newServiceYaml, err = yaml.Marshal(k8sservice)
Expect(err).NotTo(HaveOccurred(), "marshalling service")
diff --git a/test/e2e/gatewayapi/status.go b/test/e2e/gatewayapi/status.go
index 85bc2dee..a79d5559 100644
--- a/test/e2e/gatewayapi/status.go
+++ b/test/e2e/gatewayapi/status.go
@@ -154,6 +154,12 @@ spec:
Expect(err).NotTo(HaveOccurred(), "getting service yaml")
err = yaml.Unmarshal([]byte(serviceYaml), &k8sservice)
Expect(err).NotTo(HaveOccurred(), "unmarshalling service")
+ // Switching to ExternalName released the allocated node ports, and a service
+ // in a parallel test namespace may have taken them since. Ask for fresh ones
+ // instead of the old numbers, which would fail with "already allocated".
+ for i := range oldSpec.Ports {
+ oldSpec.Ports[i].NodePort = 0
+ }
k8sservice.Spec = oldSpec
newServiceYaml, err = yaml.Marshal(k8sservice)
Expect(err).NotTo(HaveOccurred(), "marshalling service")