Skip to content

Commit e6f17b8

Browse files
holserciecierski
authored andcommitted
Fix EDPM ovn update
In some topologies, for example Unidelta topology, nodeset include external ceph nodes. Those nodes are not hosting ovn services. Update fails trying to run ovn update setep on those nodes. This patch improves creation of edpm-deployment-ovn-update.yaml file to include only nodesets with ovn service enabled during initial deployment. Closes: OSPCIX-738
1 parent b5343f7 commit e6f17b8

File tree

1 file changed

+19
-4
lines changed

1 file changed

+19
-4
lines changed

scripts/openstack-update.sh

Lines changed: 19 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -115,8 +115,23 @@ oc wait $OPENSTACK_VERSION_CR --for=condition=MinorUpdateOVNControlplane --timeo
115115
get_current_state "02_after_ovn_controlplane_update"
116116

117117
# start ovn update on data plane
118-
DATAPLANE_NODESET=$(oc get openstackdataplanenodeset -o name | awk -F'/' '{print " - " $2}')
119-
DATAPLANE_DEPLOYMENT=$(oc get openstackdataplanedeployment -o name | awk -F'/' '{print $2; exit}')
118+
nodes_with_ovn=()
119+
# Get the names of all OpenStackDataPlaneNodeSet resources
120+
openstackdataplanenodesets=$(oc get openstackdataplanenodeset -o custom-columns=NAME:.metadata.name,SERVICES:.spec.services --no-headers)
121+
122+
# Loop through each OpenStackDataPlaneNodeSet
123+
while read -r node_name services; do
124+
# Check if 'ovn' is in the list of services
125+
for service in ${services[@]};do
126+
if [[ "$service" == *"ovn"* ]]; then
127+
nodes_with_ovn+=("- $node_name")
128+
break
129+
fi
130+
done
131+
done <<< $openstackdataplanenodesets
132+
133+
DATAPLANE_DEPLOYMENT=edpm
134+
NODE_SETS=$(printf ' %s\n' "${nodes_with_ovn[@]}")
120135

121136
cat <<EOF >edpm-deployment-ovn-update.yaml
122137
apiVersion: dataplane.openstack.org/v1beta1
@@ -125,14 +140,14 @@ metadata:
125140
name: $DATAPLANE_DEPLOYMENT-ovn-update
126141
spec:
127142
nodeSets:
128-
$DATAPLANE_NODESET
143+
$NODE_SETS
129144
servicesOverride:
130145
- ovn
131146
EOF
132147

133148
oc create -f edpm-deployment-ovn-update.yaml
134149

135-
oc get openstackdataplanedeployment
150+
oc get openstackdataplanedeployment ${DATAPLANE_DEPLOYMENT}-ovn-update -o yaml
136151
# wait for ovn dataplane completes
137152
oc wait $OPENSTACK_VERSION_CR --for=condition=MinorUpdateOVNDataplane --timeout=$TIMEOUT
138153
echo "MinorUpdateOVNDataplane completed"

0 commit comments

Comments
 (0)