From 8c3af4eb9713c288e969587e4ca2d3d2853b0826 Mon Sep 17 00:00:00 2001 From: Martin Schuppert Date: Mon, 2 Dec 2024 17:36:17 +0100 Subject: [PATCH] Add timestamp as suffix to the OpenStackVersion Right now when a PR merges, the build openstack-operator has the OpenStackVersion 0.0.1. Since they are all the same for each PR it is not possible to test updates. Lets add the seconds since the Epoch as a suffix so that we get a different OpenStackVersion with each operator build. Signed-off-by: Martin Schuppert --- Makefile | 6 +++++- hack/export_related_images.sh | 2 +- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/Makefile b/Makefile index a2dcbcb06..ce6883e9b 100644 --- a/Makefile +++ b/Makefile @@ -5,6 +5,8 @@ # - use environment variables to overwrite this value (e.g export VERSION=0.0.2) VERSION ?= 0.0.1 +OPENSTACK_RELEASE_VERSION ?= $(VERSION)-$(shell date +%s) + # CHANNELS define the bundle channels used in the bundle. # Add a new line here if you would like to change its default config. (E.g CHANNELS = "candidate,fast,stable") # To re-generate a bundle for other specific channels without changing the standard setup, you can: @@ -338,7 +340,9 @@ endif .PHONY: bundle bundle: build manifests kustomize operator-sdk ## Generate bundle manifests and metadata, then validate generated files. $(OPERATOR_SDK) generate kustomize manifests -q - cd config/manager && $(KUSTOMIZE) edit set image controller=$(IMG) + cd config/manager && \ + $(KUSTOMIZE) edit set image controller=$(IMG) && \ + $(KUSTOMIZE) edit add patch --kind Deployment --name controller-manager --namespace system --patch "[{\"op\": \"replace\", \"path\": \"/spec/template/spec/containers/0/env/0\", \"value\": {\"name\": \"OPENSTACK_RELEASE_VERSION\", \"value\": \"$(OPENSTACK_RELEASE_VERSION)\"}}]" $(KUSTOMIZE) build config/manifests | $(OPERATOR_SDK) generate bundle $(BUNDLE_GEN_FLAGS) cp dependencies.yaml ./bundle/metadata $(OPERATOR_SDK) bundle validate ./bundle diff --git a/hack/export_related_images.sh b/hack/export_related_images.sh index 6b9045d11..b025b130a 100755 --- a/hack/export_related_images.sh +++ b/hack/export_related_images.sh @@ -1,6 +1,6 @@ #!/bin/bash -export OPENSTACK_RELEASE_VERSION=0.0.1 +export OPENSTACK_RELEASE_VERSION=0.0.1-$(date +%s) export RELATED_IMAGE_OPENSTACK_CLIENT_IMAGE_URL_DEFAULT=quay.io/podified-antelope-centos9/openstack-openstackclient:current-podified export RELATED_IMAGE_RABBITMQ_IMAGE_URL_DEFAULT=quay.io/podified-antelope-centos9/openstack-rabbitmq:current-podified export RELATED_IMAGE_KEYSTONE_API_IMAGE_URL_DEFAULT=quay.io/podified-antelope-centos9/openstack-keystone:current-podified