From e8ff91fe395dcb28b6b3cf7cb1b9f3b46a806ca8 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 | 48 ++++++++++++++++++- 1 file changed, 46 insertions(+), 2 deletions(-) diff --git a/openstack/tools/upload_octavia_amphora_image.sh b/openstack/tools/upload_octavia_amphora_image.sh index af6b0bfa..6fe86311 100755 --- a/openstack/tools/upload_octavia_amphora_image.sh +++ b/openstack/tools/upload_octavia_amphora_image.sh @@ -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 <&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}