From 3109c6a0cf828000a76e55b3654407ec688c4140 Mon Sep 17 00:00:00 2001 From: Nicolas Bock Date: Fri, 6 Dec 2024 15:23:22 -0700 Subject: [PATCH] Fix upload octavia script Signed-off-by: Nicolas Bock --- .../tools/upload_octavia_amphora_image.sh | 49 ++++++++++++++++++- 1 file changed, 47 insertions(+), 2 deletions(-) diff --git a/openstack/tools/upload_octavia_amphora_image.sh b/openstack/tools/upload_octavia_amphora_image.sh index af6b0bfa..ad72e712 100755 --- a/openstack/tools/upload_octavia_amphora_image.sh +++ b/openstack/tools/upload_octavia_amphora_image.sh @@ -1,2 +1,47 @@ -#!/bin/bash -eu -juju run octavia-diskimage-retrofit/0 retrofit-image +#!/bin/bash + +set -e -u + +basedir=$(realpath $(dirname $0)) +source ${basedir}/../novarc + +: ${series:=jammy} + +while (( $# > 0 )); do + case $1 in + -h|--help) + cat <&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}