Skip to content

Commit

Permalink
Fix upload octavia script
Browse files Browse the repository at this point in the history
Signed-off-by: Nicolas Bock <[email protected]>
  • Loading branch information
nicolasbock committed Dec 9, 2024
1 parent 510a665 commit e8ff91f
Showing 1 changed file with 46 additions and 2 deletions.
48 changes: 46 additions & 2 deletions openstack/tools/upload_octavia_amphora_image.sh
Original file line number Diff line number Diff line change
@@ -1,2 +1,46 @@
#!/bin/bash -eu
juju run octavia-diskimage-retrofit/0 retrofit-image
#!/bin/bash

set -e -u

declare amphora_series=jammy

while (( $# > 0 )); do
case $1 in
-h|--help)
cat <<EOF
Usage:
-h | --help This help
--series SERIES The series (also the image name) to use as the amphora base
EOF
exit
;;
--series)
shift
amphora_series=$1
;;
*)
echo "unknown option"
exit 1
;;
esac
shift
done

basedir=$(realpath $(dirname $0))
source ${basedir}/../novarc

ID=$(openstack image show --format value --column id ${amphora_series})

TASK=$(juju run octavia-diskimage-retrofit/0 retrofit-image source-image=${ID} --background 2>&1 | grep show-task | sed --regexp-extended 's/^.*task ([0-9]+).*/\1/')

echo -n "Running retrofit"
while [[ $(juju show-task ${TASK}) =~ running ]]; do
echo -n .
sleep 5
done
echo

ID=$(openstack image list --format json | jq --raw-output '.[] | select(.Name | match("amphora")) | .ID')

openstack image set --tag octavia-amphora ${ID}

0 comments on commit e8ff91f

Please sign in to comment.