blob: 783cba86bc34fab51a5f1737fa909242b05bafad [file] [log] [blame]
Vasyl Saienko775c1da2023-07-13 11:34:25 +00001EXAMPLES_DIR=$(cd $(dirname "$0")/.. && pwd)
2WORKDIR=$(cd $(dirname "$0") && pwd)
3source ${EXAMPLES_DIR}/lib.sh
4
5command=$1
6
7function run {
8 echo "Creating PVC"
9 kubectl apply -f pvc.yaml
10
11 echo "Creating VM"
12 kubectl apply -f cirros.yaml
13
14 echo "Starting VM"
15 virtctl start cirros-volumes
16
17 echo "Waiting VM is Running."
18 wait_vm_state cirros-volumes Running
19}
20
21function cleanup {
22 kubectl delete -f cirros.yaml
23 kubectl delete -f pvc.yaml
24}
25
26pushd $WORKDIR
27$command
28popd