From 6dd495c87dfe1bd1fc46861db10754c9f5b91734 Mon Sep 17 00:00:00 2001 From: Alan Conway Date: Mon, 15 Dec 2025 09:29:21 -0500 Subject: [PATCH] chore: Fix warnings during image build. --- Makefile | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/Makefile b/Makefile index 0dc662e7f..4811c7e28 100644 --- a/Makefile +++ b/Makefile @@ -18,7 +18,7 @@ export GODEBUG=x509ignoreCN=0 # Set variables from environment or hard-coded default export OPERATOR_NAME=cluster-logging-operator -export CURRENT_BRANCH=$(shell git rev-parse --abbrev-ref HEAD;) +export CURRENT_BRANCH=$(shell git rev-parse --short HEAD 2> /dev/null) export IMAGE_TAG?=127.0.0.1:5000/openshift/origin-$(OPERATOR_NAME):$(CURRENT_BRANCH) export LOGGING_VERSION?=6.4 @@ -299,7 +299,6 @@ test-upgrade: $(JUNITREPORT) RELATED_IMAGE_LOG_FILE_METRIC_EXPORTER=$(IMAGE_LOGFILEMETRICEXPORTER) \ IMAGE_LOGGING_EVENTROUTER=$(IMAGE_LOGGING_EVENTROUTER) \ exit 0 - .PHONY: test-e2e test-e2e: $(JUNITREPORT) @@ -342,10 +341,13 @@ cluster-logging-catalog: cluster-logging-catalog-build cluster-logging-catalog-d .PHONY: cluster-logging-cleanup cluster-logging-cleanup: cluster-logging-operator-uninstall cluster-logging-catalog-uninstall +# olm_deploy targets excluded if olm_deploy does not exist - e.g. during image build. +ifneq ($(wildcard olm_deploy),) + .PHONY: cluster-logging-catalog-build # builds an operator-registry image containing the cluster-logging operator cluster-logging-catalog-build: .target/cluster-logging-catalog-build -.target/cluster-logging-catalog-build: $(shell find olm_deploy -type f) +.target/cluster-logging-catalog-build: olm_deploy/scripts/catalog-build.sh touch $@ @@ -369,6 +371,8 @@ cluster-logging-operator-install: cluster-logging-operator-uninstall: olm_deploy/scripts/operator-uninstall.sh +endif + # # Targets for installing the operator to a cluster using operator-sdk run bundle # @@ -380,7 +384,7 @@ cluster-logging-operator-uninstall: REGISTRY_BASE ?= $(error REGISTRY_BASE needs to be set for the olm- targets to work) REPOSITORY_BASE ?= $(REGISTRY_BASE)/cluster-logging-operator -DEV_VERSION := 0.0.1$(shell date +%m%d%H%M)-$(shell git rev-parse --short HEAD) +DEV_VERSION := 0.0.1$(shell date +%m%d%H%M)-$(CURRENT_BRANCH) OLM_VERSION ?= $(DEV_VERSION) OPERATOR_IMAGE ?= $(REPOSITORY_BASE):$(OLM_VERSION) BUNDLE_IMAGE ?= $(REPOSITORY_BASE)-bundle:$(OLM_VERSION)