Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 8 additions & 4 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Copy link
Contributor

@xperimental xperimental Dec 15, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
export CURRENT_BRANCH=$(shell git rev-parse --short HEAD 2> /dev/null)
export CURRENT_BRANCH=$(shell git rev-parse --short HEAD 2> /dev/null)

fwiw: "current branch" is then also wrong as the output of rev-parse --short HEAD will always be a commit-hash.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is not CURRENT_BRANCH anymore, maybe make sense to change variable name to CURRENT_REVISION or something like this

export IMAGE_TAG?=127.0.0.1:5000/openshift/origin-$(OPERATOR_NAME):$(CURRENT_BRANCH)

export LOGGING_VERSION?=6.4
Expand Down Expand Up @@ -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)
Expand Down Expand Up @@ -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:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I wonder if we can just remove the dependency on this and the target below. The lower one is already phony, so its dependencies do not really matter anyway ... and I think this one can lose its indirection and be made phony as well.

olm_deploy/scripts/catalog-build.sh
touch $@

Expand All @@ -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
#
Expand All @@ -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)
Expand Down