-
Notifications
You must be signed in to change notification settings - Fork 8
149 lines (120 loc) · 5.87 KB
/
Copy pathdevstack.yml
File metadata and controls
149 lines (120 loc) · 5.87 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
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
name: devstack
on:
pull_request:
env:
# renovate: datasource=github-releases depName=kubernetes-sigs/external-dns
CI_EXTERNAL_DNS_VERSION: v0.20.0
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: ${{ env.CI_EXTERNAL_DNS_VERSION }}
- 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.27.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: Fix Designate root_helper
# root_helper defaults to "sudo designate-rootwrap ..." in designate/conf/base.py.
# designate-rootwrap lives in the devstack venv (/opt/stack/data/venv/bin) which
# is not in sudo's secure_path -> every rndc addzone fails -> zones PENDING->ERROR.
# Insert the absolute path immediately after [DEFAULT] so oslo.config picks it up.
run: |
sudo sed -i '/^\[DEFAULT\]/a root_helper = sudo /opt/stack/data/venv/bin/designate-rootwrap /etc/designate/rootwrap.conf' \
/etc/designate/designate.conf
shell: bash
- 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 value --status 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 value --status 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
- name: Create zone all-projects.test in alt_demo project
run: |
openstack --os-cloud devstack-alt zone create --email admin@example.com all-projects.test.
- name: Wait for all-projects.test zone creation
run: |
while [ "$(openstack --os-cloud devstack-admin zone list -f value --status PENDING --all-projects)" != "" ]; do date; openstack --os-cloud devstack-admin zone list -f value --all-projects; sleep 1; done
- name: Kill external-dns-openstack-webhook
run: pkill -f external-dns-openstack-webhook || true
- name: Start external-dns-openstack-webhook as admin with --all-projects
run: |
OS_CLOUD=devstack-admin ./build/bin/external-dns-openstack-webhook --all-projects --domain-filter all-projects.test >/tmp/external-dns-openstack-webhook-all-projects.log 2>&1 &
for i in $(seq 30); do curl -sf http://127.0.0.1:8888 > /dev/null 2>&1 && break; sleep 1; done
curl -sf http://127.0.0.1:8888 > /dev/null || { cat /tmp/external-dns-openstack-webhook-all-projects.log; exit 1; }
- name: Run external-dns against all-projects.test as admin user
run: ./build/external-dns --txt-owner-id all-projects-cluster-id --provider webhook --source fake --fqdn-template=all-projects.test --log-level=debug --once 2>&1
working-directory: ./external-dns
- name: Show /tmp/external-dns-openstack-webhook-all-projects.log
run: cat /tmp/external-dns-openstack-webhook-all-projects.log
- name: Check all-projects created entries in all-projects.test
run: |
if [ $(openstack --os-cloud devstack-admin recordset list all-projects.test. --all-projects -f value | grep -c "all-projects-cluster-id") -ne 10 ]; then exit 1; fi