Skip to content

Commit 6136d77

Browse files
committed
fix: apisix standalone write yaml
Signed-off-by: ashing <[email protected]>
1 parent e82446e commit 6136d77

File tree

3 files changed

+29
-8
lines changed

3 files changed

+29
-8
lines changed

test/e2e/apisix/basic.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ var _ = Describe("APISIX Standalone Basic Tests", func() {
3232
// Test basic connectivity
3333
httpClient.GET("/anything").
3434
Expect().
35-
Status(404).Body().Contains("404 not found")
35+
Status(404).Body().Contains("404 Route Not Found")
3636
})
3737
})
3838
})

test/e2e/framework/manifests/apisix-standalone.yaml

Lines changed: 24 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,24 @@ spec:
3636
labels:
3737
app.kubernetes.io/name: apisix
3838
spec:
39+
initContainers:
40+
- name: config-setup
41+
image: apache/apisix:dev
42+
command:
43+
- sh
44+
- -c
45+
- |
46+
echo "Copying default config directory to writable volume"
47+
cp -r /usr/local/apisix/conf/* /tmp/apisix-conf/
48+
echo "Overwriting config.yaml with custom configuration"
49+
cp /tmp/config-source/config.yaml /tmp/apisix-conf/config.yaml
50+
echo "Config setup completed successfully"
51+
ls -la /tmp/apisix-conf/
52+
volumeMounts:
53+
- name: config-source
54+
mountPath: /tmp/config-source
55+
- name: config-writable
56+
mountPath: /tmp/apisix-conf
3957
containers:
4058
- name: apisix
4159
image: apache/apisix:dev
@@ -50,13 +68,14 @@ spec:
5068
containerPort: 9180
5169
protocol: TCP
5270
volumeMounts:
53-
- name: conf
54-
mountPath: /usr/local/apisix/conf/config.yaml
55-
subPath: config.yaml
71+
- name: config-writable
72+
mountPath: /usr/local/apisix/conf
5673
volumes:
57-
- name: conf
74+
- name: config-source
5875
configMap:
5976
name: apisix-conf
77+
- name: config-writable
78+
emptyDir: {}
6079
---
6180
apiVersion: v1
6281
kind: Service
@@ -66,7 +85,7 @@ metadata:
6685
app.kubernetes.io/name: apisix
6786
spec:
6887
ports:
69-
- port: {{ .ServiceHTTPPort}}
88+
- port: {{ .ServiceHTTPPort }}
7089
name: http
7190
protocol: TCP
7291
targetPort: 9080

test/e2e/scaffold/apisix_deployer.go

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -110,8 +110,10 @@ func (s *APISIXDeployer) AfterEach() {
110110

111111
func (s *APISIXDeployer) DeployDataplane() {
112112
opts := APISIXDeployOptions{
113-
Namespace: s.namespace,
114-
AdminKey: s.opts.APISIXAdminAPIKey,
113+
Namespace: s.namespace,
114+
AdminKey: s.opts.APISIXAdminAPIKey,
115+
ServiceHTTPPort: 9080,
116+
ServiceHTTPSPort: 9443,
115117
}
116118
svc := s.deployDataplane(&opts)
117119
s.dataplaneService = svc

0 commit comments

Comments
 (0)