Skip to content

Commit 8d91d0d

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 8d91d0d

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

Diff for: Makefile

+4-2
Original file line numberDiff line numberDiff line change
@@ -312,8 +312,8 @@ 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)
@@ -323,6 +323,8 @@ ifndef RELEASE_VERSION
323323
endif
324324
@echo "Getting operator registry image"
325325
docker pull $(OPERATOR_REGISTRY_IMAGE)
326+
@echo "Using OPM image $(OPM_IMAGE_REF)"
327+
@echo "Using OLM image $(OLM_RELEASE_IMG_REF)"
326328
$(YQ) w -i deploy/$(TARGET)/values.yaml olm.image.ref $(OLM_RELEASE_IMG_REF)
327329
$(YQ) w -i deploy/$(TARGET)/values.yaml catalog.image.ref $(OLM_RELEASE_IMG_REF)
328330
$(YQ) w -i deploy/$(TARGET)/values.yaml package.image.ref $(OLM_RELEASE_IMG_REF)

0 commit comments

Comments
 (0)