Skip to content

Commit

Permalink
Add proper integration check for nested config (#248)
Browse files Browse the repository at this point in the history
  • Loading branch information
abtreece authored May 19, 2024
1 parent 4046a1a commit d401555
Show file tree
Hide file tree
Showing 5 changed files with 23 additions and 6 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/integration-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ jobs:
ports:
- 8500:8500
etcd:
image: quay.io/coreos/etcd
image: quay.io/coreos/etcd:v3.5.13
ports:
- 2379:2379
env:
Expand Down
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM golang:1.21.6-alpine
FROM golang:1.22.2-alpine

RUN apk add --no-cache make git
RUN mkdir -p /go/src/github.com/abtreece/confd && \
Expand Down
7 changes: 3 additions & 4 deletions test/docker-compose.yml
Original file line number Diff line number Diff line change
@@ -1,12 +1,11 @@
version: "3.9"
services:
consul:
image: consul
image: hashicorp/consul
ports:
- 8500:8500

etcd:
image: quay.io/coreos/etcd
image: quay.io/coreos/etcd:v3.5.13
ports:
- 2379:2379
environment:
Expand All @@ -26,7 +25,7 @@ services:
- 6379:6379

vault:
image: vault
image: hashicorp/vault
ports:
- 8200:8200
environment:
Expand Down
3 changes: 3 additions & 0 deletions test/integration/expect/check.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,8 @@ diff /tmp/confd-basic-test.conf test/integration/expect/basic.conf
diff /tmp/confd-exists-test.conf test/integration/expect/exists-test.conf
diff /tmp/confd-iteration-test.conf test/integration/expect/iteration.conf
diff /tmp/confd-manykeys-test.conf test/integration/expect/basic.conf
if [ -f /tmp/confd-nested-test.conf ]; then
diff /tmp/confd-nested-test.conf test/integration/expect/nested.conf
fi

rm /tmp/confd-*;
15 changes: 15 additions & 0 deletions test/integration/expect/nested.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
upstream app {
server 10.0.1.10:8080;
server 10.0.1.11:8080;
}

server {
server_name www.example.com;
location / {
proxy_pass http://app;
proxy_redirect off;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
}
}

0 comments on commit d401555

Please sign in to comment.