Skip to content

Commit 73f842b

Browse files
committed
fix: r
Signed-off-by: Ashing Zheng <[email protected]>
1 parent 78f02b0 commit 73f842b

File tree

3 files changed

+33
-7
lines changed

3 files changed

+33
-7
lines changed

test/e2e/crds/v2/route.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -89,14 +89,14 @@ apiVersion: networking.k8s.io/%s
8989
kind: IngressClass
9090
metadata:
9191
name: apisix
92+
annotations:
93+
apisix.apache.org/parameters-namespace: %s
9294
spec:
9395
controller: "apisix.apache.org/apisix-ingress-controller"
9496
parameters:
9597
apiGroup: "apisix.apache.org"
9698
kind: "GatewayProxy"
9799
name: "apisix-proxy-config"
98-
scope: Namespace
99-
namespace: %s
100100
`
101101
BeforeEach(func() {
102102
By("create GatewayProxy")

test/e2e/crds/v2/status.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -98,14 +98,14 @@ apiVersion: networking.k8s.io/%s
9898
kind: IngressClass
9999
metadata:
100100
name: apisix
101+
annotations:
102+
apisix.apache.org/parameters-namespace: %s
101103
spec:
102104
controller: "apisix.apache.org/apisix-ingress-controller"
103105
parameters:
104106
apiGroup: "apisix.apache.org"
105107
kind: "GatewayProxy"
106108
name: "apisix-proxy-config"
107-
scope: Namespace
108-
namespace: %s
109109
`
110110
ingressClass := fmt.Sprintf(ingressClassYaml, framework.IngressVersion, s.Namespace())
111111
err = s.CreateResourceFromStringWithNamespace(ingressClass, "")

test/e2e/gatewayapi/status.go

Lines changed: 29 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,8 @@ import (
2424

2525
. "github.com/onsi/ginkgo/v2"
2626
. "github.com/onsi/gomega"
27-
"gopkg.in/yaml.v3"
2827
corev1 "k8s.io/api/core/v1"
28+
"sigs.k8s.io/yaml"
2929

3030
"github.com/apache/apisix-ingress-controller/internal/provider/adc"
3131
"github.com/apache/apisix-ingress-controller/test/e2e/framework"
@@ -66,7 +66,26 @@ metadata:
6666
spec:
6767
controllerName: %s
6868
`
69-
const gatewayProxy = `
69+
70+
var gatewayProxyYaml = `
71+
apiVersion: apisix.apache.org/v1alpha1
72+
kind: GatewayProxy
73+
metadata:
74+
name: apisix-proxy-config
75+
spec:
76+
provider:
77+
type: ControlPlane
78+
controlPlane:
79+
service:
80+
name: %s
81+
port: 9180
82+
auth:
83+
type: AdminKey
84+
adminKey:
85+
value: "%s"
86+
`
87+
88+
var gatewayProxyYamlAPI7 = `
7089
apiVersion: apisix.apache.org/v1alpha1
7190
kind: GatewayProxy
7291
metadata:
@@ -82,6 +101,13 @@ spec:
82101
adminKey:
83102
value: "%s"
84103
`
104+
getGatewayProxySpec := func() string {
105+
if s.Deployer.Name() == adc.BackendModeAPI7EE {
106+
return fmt.Sprintf(gatewayProxyYamlAPI7, s.Deployer.GetAdminEndpoint(), s.AdminKey())
107+
}
108+
return fmt.Sprintf(gatewayProxyYaml, framework.ProviderType, s.AdminKey())
109+
}
110+
85111
const defaultGateway = `
86112
apiVersion: gateway.networking.k8s.io/v1
87113
kind: Gateway
@@ -101,7 +127,7 @@ spec:
101127
`
102128
BeforeEach(func() {
103129
By("create GatewayProxy")
104-
gatewayProxy := fmt.Sprintf(gatewayProxy, s.Deployer.GetAdminEndpoint(), s.AdminKey())
130+
gatewayProxy := getGatewayProxySpec()
105131
err := s.CreateResourceFromString(gatewayProxy)
106132
Expect(err).NotTo(HaveOccurred(), "creating GatewayProxy")
107133
time.Sleep(5 * time.Second)

0 commit comments

Comments
 (0)