Skip to content

Commit bf538ed

Browse files
author
Mikalai Radchuk
committed
Fix canonical image ref resolution
Adds a new util to reliably resolve canonical reference to the image. 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 bf538ed

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

Diff for: Makefile

+4-4
Original file line numberDiff line numberDiff line change
@@ -312,17 +312,17 @@ pull-opm:
312312

313313
.PHONY: package
314314
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))
315+
package: OLM_RELEASE_IMG_REF=$(shell docker images --format='{{.Digest}}' $(IMAGE_REPO):$(RELEASE_VERSION))
316+
package: OPM_IMAGE_REF=$(shell docker images --format='{{.Digest}}' $(OPERATOR_REGISTRY_IMAGE))
317317
package:
318318
ifndef TARGET
319319
$(error TARGET is undefined)
320320
endif
321321
ifndef RELEASE_VERSION
322322
$(error RELEASE_VERSION is undefined)
323323
endif
324-
@echo "Getting operator registry image"
325-
docker pull $(OPERATOR_REGISTRY_IMAGE)
324+
@echo "Using OPM image $(OPM_IMAGE_REF)"
325+
@echo "Using OLM image $(OLM_RELEASE_IMG_REF)"
326326
$(YQ) w -i deploy/$(TARGET)/values.yaml olm.image.ref $(OLM_RELEASE_IMG_REF)
327327
$(YQ) w -i deploy/$(TARGET)/values.yaml catalog.image.ref $(OLM_RELEASE_IMG_REF)
328328
$(YQ) w -i deploy/$(TARGET)/values.yaml package.image.ref $(OLM_RELEASE_IMG_REF)

0 commit comments

Comments
 (0)