Skip to content

Commit 2c5f4c9

Browse files
author
Mikalai Radchuk
committed
Fix canonical image ref resolution
Previously in release scripts we were using `docker inspect` which seems to sort .RepoDigests and it makes selection of the correct digest difficult because platform-specific digest can appear at a different index depending on the digests in the list. Signed-off-by: Mikalai Radchuk <[email protected]>
1 parent 2dd27bd commit 2c5f4c9

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

Diff for: Makefile

+6-3
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,8 @@ OPERATOR_REGISTRY_VERSION ?= $(shell go list -m github.com/operator-framework/op
5656

5757
# Pin operator registry images to the same version as the operator registry
5858
export OPERATOR_REGISTRY_TAG ?= v$(OPERATOR_REGISTRY_VERSION)
59-
export OPERATOR_REGISTRY_IMAGE ?= quay.io/operator-framework/opm:$(OPERATOR_REGISTRY_TAG)
59+
export OPERATOR_REGISTRY_REPO ?= quay.io/operator-framework/opm
60+
export OPERATOR_REGISTRY_IMAGE ?= $(OPERATOR_REGISTRY_REPO):$(OPERATOR_REGISTRY_TAG)
6061
export CONFIGMAP_SERVER_IMAGE ?= quay.io/operator-framework/configmap-operator-registry:$(OPERATOR_REGISTRY_TAG)
6162

6263
# Artifact settings #
@@ -312,8 +313,8 @@ pull-opm:
312313

313314
.PHONY: package
314315
package: $(YQ) $(HELM) #HELP Package OLM for release
315-
package: OLM_RELEASE_IMG_REF=$(shell docker inspect --format='{{index .RepoDigests 0}}' $(IMAGE_REPO):$(RELEASE_VERSION))
316-
package: OPM_IMAGE_REF=$(shell docker inspect --format='{{index .RepoDigests 0}}' $(OPERATOR_REGISTRY_IMAGE))
316+
package: OLM_RELEASE_IMG_REF=$(IMAGE_REPO)@$(shell docker images --format='{{.Digest}}' $(IMAGE_REPO):$(RELEASE_VERSION))
317+
package: OPM_IMAGE_REF=$(OPERATOR_REGISTRY_REPO)@$(shell docker images --format='{{.Digest}}' $(OPERATOR_REGISTRY_IMAGE))
317318
package:
318319
ifndef TARGET
319320
$(error TARGET is undefined)
@@ -323,6 +324,8 @@ ifndef RELEASE_VERSION
323324
endif
324325
@echo "Getting operator registry image"
325326
docker pull $(OPERATOR_REGISTRY_IMAGE)
327+
@echo "Using OPM image $(OPM_IMAGE_REF)"
328+
@echo "Using OLM image $(OLM_RELEASE_IMG_REF)"
326329
$(YQ) w -i deploy/$(TARGET)/values.yaml olm.image.ref $(OLM_RELEASE_IMG_REF)
327330
$(YQ) w -i deploy/$(TARGET)/values.yaml catalog.image.ref $(OLM_RELEASE_IMG_REF)
328331
$(YQ) w -i deploy/$(TARGET)/values.yaml package.image.ref $(OLM_RELEASE_IMG_REF)

0 commit comments

Comments
 (0)