Skip to content

Commit 38557d3

Browse files
authored
feat: change etcd prefix for ssl and proto (#2693)
1 parent 8d6d1c7 commit 38557d3

File tree

9 files changed

+118
-90
lines changed

9 files changed

+118
-90
lines changed

.github/workflows/backend-e2e-test.yml

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -47,11 +47,6 @@ jobs:
4747
sed -i '[email protected]/0:[email protected]:9000@' ./api/conf/conf.yaml
4848
sed -i 's/enabled: false/enabled: true/' ./api/conf/conf.yaml
4949
50-
- name: download file Dockerfile-apisix
51-
working-directory: ./api/test/docker
52-
run: |
53-
curl -o Dockerfile-apisix https://raw.githubusercontent.com/apache/apisix-docker/master/alpine/Dockerfile
54-
5550
- name: build docker images
5651
working-directory: ./api/test/docker
5752
continue-on-error: true

api/go.mod

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,18 +8,18 @@ require (
88
github.com/getkin/kin-openapi v0.33.0
99
github.com/gin-contrib/gzip v0.0.3
1010
github.com/gin-contrib/static v0.0.0-20200916080430-d45d9a37d28e
11-
github.com/gin-gonic/gin v1.6.3
11+
github.com/gin-gonic/gin v1.7.0
1212
github.com/golang-jwt/jwt v3.2.2+incompatible
1313
github.com/gorilla/sessions v1.2.1
1414
github.com/juliangruber/go-intersect v1.1.0
1515
github.com/pkg/errors v0.9.1
1616
github.com/satori/go.uuid v1.2.0
17-
github.com/shiningrush/droplet v0.2.6-0.20210127040147-53817015cd1b
18-
github.com/shiningrush/droplet/wrapper/gin v0.2.1
17+
github.com/shiningrush/droplet v0.3.0
18+
github.com/shiningrush/droplet/wrapper/gin v0.3.0
1919
github.com/sony/sonyflake v1.0.0
2020
github.com/spf13/cobra v1.6.1
2121
github.com/spf13/viper v1.8.1
22-
github.com/stretchr/testify v1.7.1
22+
github.com/stretchr/testify v1.8.0
2323
github.com/tidwall/gjson v1.6.7
2424
github.com/xeipuuv/gojsonschema v1.2.0
2525
github.com/yuin/gopher-lua v0.0.0-20200816102855-ee81675732da

api/go.sum

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -130,8 +130,9 @@ github.com/gin-contrib/sse v0.1.0/go.mod h1:RHrZQHXnP2xjPF+u1gW/2HnVO7nvIa9PG3Gm
130130
github.com/gin-contrib/static v0.0.0-20200916080430-d45d9a37d28e h1:8bZpGwoPxkaivQPrAbWl+7zjjUcbFUnYp7yQcx2r2N0=
131131
github.com/gin-contrib/static v0.0.0-20200916080430-d45d9a37d28e/go.mod h1:VhW/Ch/3FhimwZb8Oj+qJmdMmoB8r7lmJ5auRjm50oQ=
132132
github.com/gin-gonic/gin v1.5.0/go.mod h1:Nd6IXA8m5kNZdNEHMBd93KT+mdY3+bewLgRvmCsR2Do=
133-
github.com/gin-gonic/gin v1.6.3 h1:ahKqKTFpO5KTPHxWZjEdPScmYaGtLo8Y4DMHoEsnp14=
134133
github.com/gin-gonic/gin v1.6.3/go.mod h1:75u5sXoLsGZoRN5Sgbi1eraJ4GU3++wFwWzhwvtwp4M=
134+
github.com/gin-gonic/gin v1.7.0 h1:jGB9xAJQ12AIGNB4HguylppmDK1Am9ppF7XnGXXJuoU=
135+
github.com/gin-gonic/gin v1.7.0/go.mod h1:jD2toBW3GZUr5UMcdrwQA10I7RuaFOl/SGeDjXkfUtY=
135136
github.com/go-gl/glfw v0.0.0-20190409004039-e6da0acd62b1/go.mod h1:vR7hzQXu2zJy9AVAgeJqvqgH9Q5CA+iKCZ2gyEVpxRU=
136137
github.com/go-gl/glfw/v3.3/glfw v0.0.0-20191125211704-12ad95a8df72/go.mod h1:tQ2UAYgL5IevRw8kRxooKSPJfGvJ9fJQFa0TUsXzTg8=
137138
github.com/go-gl/glfw/v3.3/glfw v0.0.0-20200222043503-6f7a984d4dc4/go.mod h1:tQ2UAYgL5IevRw8kRxooKSPJfGvJ9fJQFa0TUsXzTg8=
@@ -154,8 +155,9 @@ github.com/go-playground/universal-translator v0.16.0/go.mod h1:1AnU7NaIRDWWzGEK
154155
github.com/go-playground/universal-translator v0.17.0 h1:icxd5fm+REJzpZx7ZfpaD876Lmtgy7VtROAbHHXk8no=
155156
github.com/go-playground/universal-translator v0.17.0/go.mod h1:UkSxE5sNxxRwHyU+Scu5vgOQjsIJAF8j9muTVoKLVtA=
156157
github.com/go-playground/validator/v10 v10.2.0/go.mod h1:uOYAAleCW8F/7oMFd6aG0GOhaH6EGOAJShg8Id5JGkI=
157-
github.com/go-playground/validator/v10 v10.3.0 h1:nZU+7q+yJoFmwvNgv/LnPUkwPal62+b2xXj0AU1Es7o=
158158
github.com/go-playground/validator/v10 v10.3.0/go.mod h1:uOYAAleCW8F/7oMFd6aG0GOhaH6EGOAJShg8Id5JGkI=
159+
github.com/go-playground/validator/v10 v10.4.1 h1:pH2c5ADXtd66mxoE0Zm9SUhxE20r7aM3F26W0hOn+GE=
160+
github.com/go-playground/validator/v10 v10.4.1/go.mod h1:nlOn6nFhuKACm19sB/8EGNn9GlaMV7XkbRSipzJ0Ii4=
159161
github.com/go-stack/stack v1.8.0/go.mod h1:v0f6uXyyMGvRgIKkXu+yp6POWl0qKG85gN/melR3HDY=
160162
github.com/godbus/dbus/v5 v5.0.4/go.mod h1:xhWf0FNVPg57R7Z0UbKHbJfkEywrmjJnf7w5xrFpKfA=
161163
github.com/gogo/protobuf v1.1.1/go.mod h1:r8qH/GZQm5c6nD/R0oafs1akxWv10x8SbQlK7atdtwQ=
@@ -369,10 +371,10 @@ github.com/satori/go.uuid v1.2.0 h1:0uYX9dsZ2yD7q2RtLRtPSdGDWzjeM3TbMJP9utgA0ww=
369371
github.com/satori/go.uuid v1.2.0/go.mod h1:dA0hQrYB0VpLJoorglMZABFdXlWrHn1NEOzdhQKdks0=
370372
github.com/sean-/seed v0.0.0-20170313163322-e2103e2c3529/go.mod h1:DxrIzT+xaE7yg65j358z/aeFdxmN0P9QXhEzd20vsDc=
371373
github.com/shiningrush/droplet v0.2.4/go.mod h1:akW2vIeamvMD6zj6wIBfzYn6StGXBxwlW3gA+hcHu5M=
372-
github.com/shiningrush/droplet v0.2.6-0.20210127040147-53817015cd1b h1:kAS+hyJuHUm/lAN4xbKY4/QHbRse95lcjxcIZwSJEvM=
373-
github.com/shiningrush/droplet v0.2.6-0.20210127040147-53817015cd1b/go.mod h1:akW2vIeamvMD6zj6wIBfzYn6StGXBxwlW3gA+hcHu5M=
374-
github.com/shiningrush/droplet/wrapper/gin v0.2.1 h1:1o+5KUF2sKsdZ7SkmOC5ahAP1qaZKqnm0c5hOYFV6YQ=
375-
github.com/shiningrush/droplet/wrapper/gin v0.2.1/go.mod h1:cx5BfLuStFDFIKuEOc1zBTpiT3B4Ezkg3MdlP6rW51I=
374+
github.com/shiningrush/droplet v0.3.0 h1:Pqm+TmpiZLwMfNH3XEYn59nsY3Jh5ioc8Btp+JCHSRo=
375+
github.com/shiningrush/droplet v0.3.0/go.mod h1:gUZc/LriGh+fIzGeYTbGSoHv2kNcDg2BhgXVh5YSOaM=
376+
github.com/shiningrush/droplet/wrapper/gin v0.3.0 h1:QVj6qkxef0WDDECRJVD9/UP/GnPDHtWSEUrEvfUOOwc=
377+
github.com/shiningrush/droplet/wrapper/gin v0.3.0/go.mod h1:Y3nOchWIqL8rGi9GR9wR8yOtRFct/xsXSf7NydvWzVw=
376378
github.com/sirupsen/logrus v1.2.0/go.mod h1:LxeOpSwHxABJmUn/MG1IvRgCAasNZTLOkJPxbbu5VWo=
377379
github.com/sirupsen/logrus v1.4.2/go.mod h1:tLMulIdttU9McNUspp0xgXVQah82FyeX6MwdIuYE2rE=
378380
github.com/sirupsen/logrus v1.6.0/go.mod h1:7uNnSEd1DgxDLC74fIahvMZmmYsHGZGEOFrfsX/uA88=
@@ -396,16 +398,18 @@ github.com/spf13/pflag v1.0.5/go.mod h1:McXfInJRrz4CZXVZOBLb0bTZqETkiAhM9Iw0y3An
396398
github.com/spf13/viper v1.8.1 h1:Kq1fyeebqsBfbjZj4EL7gj2IO0mMaiyjYUWcUsl2O44=
397399
github.com/spf13/viper v1.8.1/go.mod h1:o0Pch8wJ9BVSWGQMbra6iw0oQ5oktSIBaujf1rJH9Ns=
398400
github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
399-
github.com/stretchr/objx v0.1.1 h1:2vfRuCMp5sSVIDSqO8oNnWJq7mPa6KVP3iPIwFBuy8A=
400401
github.com/stretchr/objx v0.1.1/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
402+
github.com/stretchr/objx v0.4.0 h1:M2gUjqZET1qApGOWNSnZ49BAIMX4F/1plDv3+l31EJ4=
403+
github.com/stretchr/objx v0.4.0/go.mod h1:YvHI0jy2hoMjB+UWwv71VJQ9isScKT/TqJzVSSt89Yw=
401404
github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs=
402405
github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI=
403406
github.com/stretchr/testify v1.4.0/go.mod h1:j7eGeouHqKxXV5pUuKE4zz7dFj8WfuZ+81PSLYec5m4=
404407
github.com/stretchr/testify v1.5.1/go.mod h1:5W2xD1RspED5o8YsWQXVCued0rvSQ+mT+I5cxcmMvtA=
405408
github.com/stretchr/testify v1.6.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg=
406409
github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg=
407-
github.com/stretchr/testify v1.7.1 h1:5TQK59W5E3v0r2duFAb7P95B6hEeOyEnHRa8MjYSMTY=
408410
github.com/stretchr/testify v1.7.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg=
411+
github.com/stretchr/testify v1.8.0 h1:pSgiaMZlXftHpm5L7V1+rVB+AZJydKsMxsQBIJw4PKk=
412+
github.com/stretchr/testify v1.8.0/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO+kdMU+MU=
409413
github.com/subosito/gotenv v1.2.0 h1:Slr1R9HxAlEKefgq5jn9U+DnETlIUa6HfgEzj0g5d7s=
410414
github.com/subosito/gotenv v1.2.0/go.mod h1:N0PQaV/YGNqwC0u51sEeR/aUtSLEXKX9iv69rRypqCw=
411415
github.com/tidwall/gjson v1.6.7 h1:Mb1M9HZCRWEcXQ8ieJo7auYyyiSux6w9XN3AdTpxJrE=

api/internal/core/store/storehub.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -137,7 +137,7 @@ func InitStores() error {
137137
}
138138

139139
err = InitStore(HubKeySsl, GenericStoreOption{
140-
BasePath: conf.ETCDConfig.Prefix + "/ssl",
140+
BasePath: conf.ETCDConfig.Prefix + "/ssls",
141141
ObjType: reflect.TypeOf(entity.SSL{}),
142142
KeyFunc: func(obj interface{}) string {
143143
r := obj.(*entity.SSL)
@@ -209,7 +209,7 @@ func InitStores() error {
209209
}
210210

211211
err = InitStore(HubKeyProto, GenericStoreOption{
212-
BasePath: conf.ETCDConfig.Prefix + "/proto",
212+
BasePath: conf.ETCDConfig.Prefix + "/protos",
213213
ObjType: reflect.TypeOf(entity.Proto{}),
214214
KeyFunc: func(obj interface{}) string {
215215
r := obj.(*entity.Proto)

api/test/docker/apisix_config.yaml

Lines changed: 9 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -17,22 +17,18 @@
1717
# If you want to set the specified configuration value, you can set the new
1818
# in this file. For example if you want to specify the etcd address:
1919
#
20-
etcd:
21-
host:
22-
- "http://etcd:2379"
23-
resync_delay: 0
20+
21+
deployment:
22+
admin:
23+
allow_admin:
24+
- 0.0.0.0/0
25+
etcd:
26+
host:
27+
- "http://etcd:2379"
28+
resync_delay: 0
2429

2530
apisix:
2631
id: "apisix-server1"
27-
admin_key:
28-
- name: "admin"
29-
key: edd1c9f034335f136f87ad84b625c8f1
30-
role: admin
31-
allow_admin:
32-
- 0.0.0.0/0
33-
admin_listen:
34-
ip: 0.0.0.0
35-
port: 9180
3632
enable_control: true
3733
control:
3834
ip: "0.0.0.0"

api/test/docker/apisix_config2.yaml

Lines changed: 9 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -17,22 +17,18 @@
1717
# If you want to set the specified configuration value, you can set the new
1818
# in this file. For example if you want to specify the etcd address:
1919
#
20-
etcd:
21-
host:
22-
- "http://etcd:2379"
23-
resync_delay: 0
20+
21+
deployment:
22+
admin:
23+
allow_admin:
24+
- 0.0.0.0/0
25+
etcd:
26+
host:
27+
- "http://etcd:2379"
28+
resync_delay: 0
2429

2530
apisix:
2631
id: "apisix-server2"
27-
admin_key:
28-
- name: "admin"
29-
key: edd1c9f034335f136f87ad84b625c8f1
30-
role: admin
31-
allow_admin:
32-
- 0.0.0.0/0
33-
admin_listen:
34-
ip: 0.0.0.0
35-
port: 9180
3632

3733
nginx_config:
3834
error_log_level: "debug"

api/test/docker/docker-compose.yaml

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -65,12 +65,10 @@ services:
6565

6666
apisix:
6767
hostname: apisix_server1
68-
image: apache/apisix:2.15.1-debian
68+
image: apache/apisix:3.0.0-debian
6969
restart: always
7070
volumes:
7171
- ./apisix_config.yaml:/usr/local/apisix/conf/config.yaml:ro
72-
- ../certs/apisix.crt:/usr/local/apisix/certs/apisix.crt:ro
73-
- ../certs/apisix.key:/usr/local/apisix/certs/apisix.key:ro
7472
- ./apisix_logs:/usr/local/apisix/logs
7573
depends_on:
7674
- etcd
@@ -91,12 +89,10 @@ services:
9189

9290
apisix2:
9391
hostname: apisix_server2
94-
image: apache/apisix:2.15.1-debian
92+
image: apache/apisix:3.0.0-debian
9593
restart: always
9694
volumes:
9795
- ./apisix_config2.yaml:/usr/local/apisix/conf/config.yaml:ro
98-
- ../certs/apisix.crt:/usr/local/apisix/certs/apisix.crt:ro
99-
- ../certs/apisix.key:/usr/local/apisix/certs/apisix.key:ro
10096
depends_on:
10197
- etcd
10298
ports:

api/test/e2e/go.mod

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,17 @@ go 1.15
55
require (
66
github.com/Nerzal/gocloak/v11 v11.2.0
77
github.com/PuerkitoBio/goquery v1.8.0
8-
github.com/gavv/httpexpect/v2 v2.3.1
9-
github.com/onsi/ginkgo v1.16.5
10-
github.com/onsi/ginkgo/v2 v2.6.1 // indirect
8+
github.com/gavv/httpexpect/v2 v2.8.0
9+
github.com/golang-jwt/jwt/v4 v4.4.3 // indirect
10+
github.com/gorilla/websocket v1.5.0 // indirect
11+
github.com/klauspost/compress v1.15.13 // indirect
12+
github.com/onsi/ginkgo v1.16.5 // indirect
13+
github.com/onsi/ginkgo/v2 v2.6.1
1114
github.com/onsi/gomega v1.24.2
12-
github.com/savsgio/gotils v0.0.0-20210617111740-97865ed5a873
13-
github.com/stretchr/testify v1.7.1
14-
github.com/tidwall/gjson v1.11.0
15+
github.com/savsgio/gotils v0.0.0-20220530130905-52f3993e8d6d
16+
github.com/sergi/go-diff v1.2.0 // indirect
17+
github.com/stretchr/testify v1.8.1
18+
github.com/tidwall/gjson v1.14.4
19+
github.com/tidwall/pretty v1.2.1 // indirect
20+
github.com/valyala/fasthttp v1.43.0 // indirect
1521
)

0 commit comments

Comments
 (0)