tacker/tools/test-setup-mgmt.sh
Yi Feng d219c49e11 Support CNF update with MgmtDriver
This patch supports MgmtDriver in the operation of modifying VNF.
It provides a sample script MgmtDriver, when modifying CNF,
If the ConfigMap and Secret are updated, the Pod and Deployment will
also be updated (image only).

Implements: blueprint container-update
Change-Id: I1e7a1b03fef13f4c7a83488f6d2fdd7efc2e454b
2022-03-10 09:48:55 +00:00

30 lines
1.1 KiB
Bash
Executable File

#!/bin/bash -xe
# The purpose of this script is to copy the MgmtDriver
# of container update in the sample folder to the
# tacker code and run it.
# Copy the MgmtDriver of container_update to the tacker.
sudo cp /opt/stack/tacker/samples/mgmt_driver/kubernetes/container_update/\
container_update_mgmt.py /opt/stack/tacker/tacker/vnfm/mgmt_drivers/
sudo chown stack:stack /opt/stack/tacker/tacker/vnfm/mgmt_drivers/\
container_update_mgmt.py
# In the configuration file of the tacker,
# add the MgmtDriver of container_update.
sudo sed -i "/VnflcmMgmtNoop/a \ \ \ \ mgmt-container-update = \
tacker.vnfm.mgmt_drivers.container_update_mgmt:ContainerUpdateMgmtDriver" \
/opt/stack/tacker/setup.cfg
sudo sed -i "/vnflcm_mgmt_driver = vnflcm_noop/a vnflcm_mgmt_driver = \
vnflcm_noop,mgmt-container-update" /etc/tacker/tacker.conf
# Reload the tacker configuration file.
cd /opt/stack/tacker/
sudo python3 setup.py build
sudo chown -R stack:stack /opt/stack/tacker/
# Restart the tacker service for the
# configuration file to take effect.
sudo systemctl restart devstack@tacker-conductor
sleep 10s