Skip to content

Commit bd943af

Browse files
committed
Remove network agents on cleanup
After successfully running the `edpm_deploy_cleanup` target we will still have the networking agents from the compute nodes as leftovers. This can be problematic if we run another `edpm_deploy` target, as we may end up with duplicated entries. This is what that looks like: ``` sh-5.1$ openstack network agent list +--------------------------------------+------------------------------+-------------------------------------+-------------------+-------+-------+----------------------------+ | ID | Agent Type | Host | Availability Zone | Alive | State | Binary | +--------------------------------------+------------------------------+-------------------------------------+-------------------+-------+-------+----------------------------+ | 3f1e061e-ab0b-450a-a85a-1fee0f1f51f1 | OVN Controller Gateway agent | crc | | :-) | UP | ovn-controller | | 85ea94df-b96c-45b4-9e6a-6666cf312b03 | OVN Controller agent | edpm-compute-0.ctlplane.example.com | | XXX | UP | ovn-controller | | 65739d21-fd79-52ed-bbdb-15359a575c01 | OVN Metadata agent | edpm-compute-0.ctlplane.example.com | | XXX | UP | neutron-ovn-metadata-agent | | 657f763c-6c7d-4f49-84ae-ad37f9316549 | OVN Controller agent | edpm-compute-0.ctlplane.example.com | | :-) | UP | ovn-controller | | 623e945b-5a8d-527f-9744-35d88c05e516 | OVN Metadata agent | edpm-compute-0.ctlplane.example.com | | :-) | UP | neutron-ovn-metadata-agent | +--------------------------------------+------------------------------+-------------------------------------+-------------------+-------+-------+----------------------------+ ``` This patch resolves this issue by removing the compute agents on the last stage of the `edpm_deploy` target.
1 parent f998b0a commit bd943af

File tree

2 files changed

+9
-0
lines changed

2 files changed

+9
-0
lines changed

Makefile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -843,6 +843,7 @@ edpm_deploy_cleanup: namespace ## cleans up the edpm instance, Does not affect t
843843
$(eval $(call vars,$@,dataplane))
844844
oc kustomize ${DEPLOY_DIR} | oc delete --ignore-not-found=true -f -
845845
${CLEANUP_DIR_CMD} ${OPERATOR_BASE_DIR}/openstack-operator ${DEPLOY_DIR}
846+
bash scripts/cleanup-edpm_deploy.sh
846847

847848
.PHONY: edpm_deploy
848849
edpm_deploy: input edpm_deploy_prep ## installs the dataplane instance using kustomize. Runs prep step in advance. Set OPENSTACK_REPO and OPENSTACK_BRANCH to deploy from a custom repo.

scripts/cleanup-edpm_deploy.sh

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
#!/bin/bash
2+
set -ex
3+
4+
# Remove all the networking agent entries in case we do another EDPM deploy
5+
AGENTS=$(oc rsh openstackclient bash -c 'openstack network agent list | grep -E "edpm-compute-.+\.ctlplane" | cut -d" " -f2 | xargs echo -n')
6+
if [[ -n "${AGENTS}" ]]; then
7+
oc rsh openstackclient bash -c "openstack network agent delete ${AGENTS}"
8+
fi

0 commit comments

Comments
 (0)