From 0c9b8e5fcad00f14ca993ec3493d4af6494ca945 Mon Sep 17 00:00:00 2001
From: Luke Repko <luke.repko@rackspace.com>
Date: Wed, 7 Aug 2024 11:26:55 -0500
Subject: [PATCH] fix: refactor image tag name and build version opt

---
 .github/workflows/release-gnocchi.yaml  | 18 ++++++++++++++----
 Containerfiles/GnocchiRXT-Containerfile |  1 -
 2 files changed, 14 insertions(+), 5 deletions(-)

diff --git a/.github/workflows/release-gnocchi.yaml b/.github/workflows/release-gnocchi.yaml
index 69f030cd3..634e6a382 100644
--- a/.github/workflows/release-gnocchi.yaml
+++ b/.github/workflows/release-gnocchi.yaml
@@ -13,16 +13,26 @@ on:
       imageTag:
         description: 'Set tag for the image'
         required: true
+        default: '2024.1-ubuntu_jammy'
+        type: choice
+        options:
+          - 2024.1-ubuntu_jammy
+      buildVersion:
+        description: 'Set version to build'
+        required: true
         default: '4.6.2'
         type: choice
         options:
           - 4.6.2
+          - stable/4.6
+          - master
 
 # Defines two custom environment variables for the workflow. These are used for the Container registry domain, and a name for the Docker image that this workflow builds.
 env:
   REGISTRY: ghcr.io
   IMAGE_NAME: ${{ github.repository  }}
-  PUSH_VERSION: 4.6.2
+  DEF_TAG_NAME: 2024.1-ubuntu_jammy
+  DEF_BUILD_VERSION: 4.6.2
 
 # There is a single job in this workflow. It's configured to run on the latest available version of Ubuntu.
 jobs:
@@ -64,8 +74,8 @@ jobs:
           file: Containerfiles/GnocchiRXT-Containerfile
           push: true
           tags: |
-            ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}/gnocchi:${{ github.event.inputs.imageTag || env.PUSH_VERSION }}
-            ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}/gnocchi:${{ github.event.inputs.imageTag || env.PUSH_VERSION }}-${{ env.MY_DATE }}
+            ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}/gnocchi:${{ github.event.inputs.imageTag || env.DEF_TAG_NAME }}
+            ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}/gnocchi:${{ github.event.inputs.imageTag || env.DEF_TAG_NAME }}-${{ env.MY_DATE }}
           labels: ${{ steps.meta.outputs.labels }}
           build-args: |
-            VERSION=${{ github.event.inputs.imageTag || env.PUSH_VERSION}}
+            VERSION=${{ github.event.inputs.buildVersion || env.DEF_BUILD_VERSION}}
diff --git a/Containerfiles/GnocchiRXT-Containerfile b/Containerfiles/GnocchiRXT-Containerfile
index 6906b9c9e..71628c5ba 100644
--- a/Containerfiles/GnocchiRXT-Containerfile
+++ b/Containerfiles/GnocchiRXT-Containerfile
@@ -1,5 +1,4 @@
 FROM ubuntu:22.04
-ARG VERSION=4.6.2
 ENV GNOCCHI_VERSION ${VERSION:-master}
 ENV DEBIAN_FRONTEND=noninteractive
 RUN apt update