virtual-deployment/libvirt/destroy_configuration.sh
Michel Thebeau 3eb7e6467e libvirt: include worker nodes in duplex configuration
Duplex configuration may include worker nodes, as described in
"Deployment Configurations" page of Starlingx docs.  Allow the
setup_configuration.sh and destroy_configuration.sh to include worker
nodes.

Test Plan:
PASS  setup/destroy configurations

Story: 2010816
Task: 49219

Change-Id: I276002255f42ca68228d179777e717fc84ea2e9a
Signed-off-by: Michel Thebeau <michel.thebeau@windriver.com>
2023-12-07 10:40:14 -05:00

49 lines
1.0 KiB
Bash
Executable File

#!/usr/bin/env bash
#
# SPDX-License-Identifier: Apache-2.0
#
# Copyright (C) 2019 Intel Corporation
#
# Copyright (c) 2023 Wind River Systems, Inc.
#
source set_defaults.sh
SCRIPT_DIR="$(dirname "$(readlink -f "${BASH_SOURCE[0]}" )" )"
source ${SCRIPT_DIR}/functions.sh
while getopts "c:" o; do
case "${o}" in
c)
CONFIGURATION=${OPTARG}
;;
*)
usage_destroy
exit 1
;;
esac
done
shift $((OPTIND-1))
if [[ -z ${CONFIGURATION} ]]; then
usage_destroy
exit -1
fi
configuration_check ${CONFIGURATION}
destroy_controller ${CONFIGURATION} ${CONTROLLER}
WORK_CFGS="duplex controllerstorage dedicatedstorage"
if [[ " $WORK_CFGS " == *" $CONFIGURATION "* ]]; then
for ((i=0; i<=$WORKER_NODES_NUMBER; i++)); do
destroy_node "worker" ${i} ${CONFIGURATION}
done
fi
if ([ "$CONFIGURATION" == "dedicatedstorage" ]); then
for ((i=0; i<=$STORAGE_NODES_NUMBER; i++)); do
destroy_node "storage" ${i} ${CONFIGURATION}
done
fi