Skip to content

Commit

Permalink
Fix canonical image ref resolution
Browse files Browse the repository at this point in the history
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]>
  • Loading branch information
Mikalai Radchuk committed Nov 7, 2024
1 parent 2dd27bd commit 2c5f4c9
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,8 @@ OPERATOR_REGISTRY_VERSION ?= $(shell go list -m github.com/operator-framework/op

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

# Artifact settings #
Expand Down Expand Up @@ -312,8 +313,8 @@ pull-opm:

.PHONY: package
package: $(YQ) $(HELM) #HELP Package OLM for release
package: OLM_RELEASE_IMG_REF=$(shell docker inspect --format='{{index .RepoDigests 0}}' $(IMAGE_REPO):$(RELEASE_VERSION))
package: OPM_IMAGE_REF=$(shell docker inspect --format='{{index .RepoDigests 0}}' $(OPERATOR_REGISTRY_IMAGE))
package: OLM_RELEASE_IMG_REF=$(IMAGE_REPO)@$(shell docker images --format='{{.Digest}}' $(IMAGE_REPO):$(RELEASE_VERSION))
package: OPM_IMAGE_REF=$(OPERATOR_REGISTRY_REPO)@$(shell docker images --format='{{.Digest}}' $(OPERATOR_REGISTRY_IMAGE))
package:
ifndef TARGET
$(error TARGET is undefined)
Expand All @@ -323,6 +324,8 @@ ifndef RELEASE_VERSION
endif
@echo "Getting operator registry image"
docker pull $(OPERATOR_REGISTRY_IMAGE)
@echo "Using OPM image $(OPM_IMAGE_REF)"
@echo "Using OLM image $(OLM_RELEASE_IMG_REF)"
$(YQ) w -i deploy/$(TARGET)/values.yaml olm.image.ref $(OLM_RELEASE_IMG_REF)
$(YQ) w -i deploy/$(TARGET)/values.yaml catalog.image.ref $(OLM_RELEASE_IMG_REF)
$(YQ) w -i deploy/$(TARGET)/values.yaml package.image.ref $(OLM_RELEASE_IMG_REF)
Expand Down

0 comments on commit 2c5f4c9

Please sign in to comment.