forked from inovex/external-dns-openstack-webhook
-
Notifications
You must be signed in to change notification settings - Fork 0
129 lines (105 loc) · 4.76 KB
/
Copy pathdevstack.yml
File metadata and controls
129 lines (105 loc) · 4.76 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
name: devstack
on:
pull_request:
env:
OS_CLOUD: devstack-admin-demo
jobs:
external-dns-source-fake:
runs-on: ubuntu-24.04
steps:
- name: Checkout external-dns-openstack-webhook
uses: actions/checkout@v7
- name: Checkout kubernetes-sigs/external-dns
uses: actions/checkout@v7
with:
repository: kubernetes-sigs/external-dns
path: ./external-dns
ref: v0.20.0
- name: Checkout openstack/devstack
uses: actions/checkout@v7
with:
repository: openstack/devstack
ref: "stable/2025.2"
path: ./devstack
- name: Set up Go
uses: actions/setup-go@v7
with:
go-version: "1.26.x"
cache-dependency-path: |
./go.sum
./external-dns/go.sum
- name: Install pip
run: python -m pip install --upgrade pip
- name: go build external-dns-openstack-webhook
run: make build
- name: go build external-dns
run: make build
working-directory: ./external-dns
- name: Configure devstack
run: |
cat <<EOF > local.conf
[[local|localrc]]
ADMIN_PASSWORD=secret
DATABASE_PASSWORD=root
RABBIT_PASSWORD=secret
SERVICE_PASSWORD=secret
LOGFILE=/var/tmp/devstack.log
USE_PYTHON3=True
INSTALL_TEMPEST=False
ENABLED_SERVICES=key,mysql,rabbit
ENABLE_HTTPD_MOD_WSGI_SERVICES=True
DESIGNATE_BACKEND_DRIVER=bind9
enable_plugin designate https://opendev.org/openstack/designate stable/2025.2
enable_service designate,designate-central,designate-api,designate-zone-manager,designate-mdns,designate-worker,designate-producer
EOF
working-directory: ./devstack
shell: bash
- name: Run stack.sh
run: ./stack.sh
working-directory: ./devstack
- name: Restart Designate
run: sudo systemctl restart "devstack@designate-*.service"
- name: Create zones example.com
run: |
openstack zone create --email admin@example.com example.com.
- name: Wait for zone creation
run: |
while [ "$(openstack zone list -f csv | grep PENDING)" != "" ]; do date; openstack zone list -f value; sleep 1; done
- name: Start external-dns-openstack-webhook in background
run: |
./build/bin/external-dns-openstack-webhook >/tmp/external-dns-openstack-webhook.log 2>&1 &
- name: Run external-dns
run: ./build/external-dns --txt-owner-id my-cluster-id --provider webhook --source fake --log-level=debug --once 2>&1
working-directory: ./external-dns
- name: Show /tmp/external-dns-openstack-webhook.log
run: cat /tmp/external-dns-openstack-webhook.log
- name: Wait for PENDING
run: |
while [ "$(openstack zone list -f csv | grep PENDING)" != "" ]; do date; openstack zone list -f value; sleep 1; done
- name: Show created entries
run: |
echo "Zones:"
openstack zone list -f value
echo "Recordsets:"
openstack recordset list all -f value
- name: Check created entries
run: |
if [ $(openstack recordset list all -f value | grep -c " TXT ") -ne 10 ]; then exit 1; fi
if [ $(openstack recordset list all -f value | grep -c " A ") -ne 10 ]; then exit 2; fi
# external-dns's `fake` source only ever produces A records, so the checks above never
# exercise AAAA handling. Regression test for a bug where the webhook's Records() call
# silently dropped AAAA recordsets, so external-dns would never see an AAAA record as
# already existing and would loop forever trying (and failing) to recreate it. Designate
# itself already had the record correctly, so `openstack recordset list` alone can't catch
# this - the bug is specifically in what the webhook reports back over its own API.
- name: Seed an AAAA recordset directly in Designate
run: |
openstack recordset create example.com. aaaa-webhook-test.example.com. --type AAAA --record 2001:db8::1
- name: Wait for AAAA recordset to become ACTIVE
run: |
while [ "$(openstack recordset list example.com. -f csv | grep PENDING)" != "" ]; do date; openstack recordset list example.com. -f value; sleep 1; done
- name: Verify the webhook reports the AAAA recordset via GET /records
run: |
curl -sf -H "Accept: application/external.dns.webhook+json;version=1" http://127.0.0.1:8888/records -o /tmp/records.json
cat /tmp/records.json
jq -e '[.[] | select(.recordType == "AAAA" and .dnsName == "aaaa-webhook-test.example.com" and (.targets[0] == "2001:db8::1"))] | length == 1' /tmp/records.json