diff --git a/Makefile b/Makefile index 11a6eac1c..a84d5679c 100644 --- a/Makefile +++ b/Makefile @@ -390,7 +390,6 @@ bundle: $(OPM) $(YQ) manifests dependencies-manifests kustomize operator-sdk ## $(call update-operator-dependencies,dns-operator,$(DNS_OPERATOR_BUNDLE_IMG)) $(OPERATOR_SDK) bundle validate ./bundle $(MAKE) bundle-ignore-createdAt - echo "$$QUAY_DOCKERFILE_LABEL" >> bundle.Dockerfile .PHONY: bundle-ignore-createdAt bundle-ignore-createdAt: @@ -405,7 +404,11 @@ bundle-ignore-createdAt: .PHONY: bundle-build bundle-build: ## Build the bundle image. + # Set quay expiry label + @echo "$$QUAY_DOCKERFILE_LABEL" >> bundle.Dockerfile $(CONTAINER_ENGINE) build --build-arg QUAY_IMAGE_EXPIRY=$(QUAY_IMAGE_EXPIRY) -f bundle.Dockerfile -t $(BUNDLE_IMG) . + # Remove quay expiry label from committed bundle Dockerfile + @sed -i '' -e '/# Quay image expiry/,+3d' bundle.Dockerfile .PHONY: bundle-push bundle-push: ## Push the bundle image. diff --git a/bundle.Dockerfile b/bundle.Dockerfile index d3daffb48..f5f5e8dc8 100644 --- a/bundle.Dockerfile +++ b/bundle.Dockerfile @@ -19,8 +19,3 @@ LABEL operators.operatorframework.io.test.config.v1=tests/scorecard/ COPY bundle/manifests /manifests/ COPY bundle/metadata /metadata/ COPY bundle/tests/scorecard /tests/scorecard/ - -# Quay image expiry -ARG QUAY_IMAGE_EXPIRY -ENV QUAY_IMAGE_EXPIRY=${QUAY_IMAGE_EXPIRY:-never} -LABEL quay.expires-after=${QUAY_IMAGE_EXPIRY} diff --git a/make/catalog.mk b/make/catalog.mk index e2c7d4193..f12e9498f 100644 --- a/make/catalog.mk +++ b/make/catalog.mk @@ -12,7 +12,6 @@ QUAY_IMAGE_EXPIRY ?= never # A LABEL that can be appended to a generated Dockerfile to set the Quay image expiration through Docker arguments. define QUAY_DOCKERFILE_LABEL - # Quay image expiry ARG QUAY_IMAGE_EXPIRY ENV QUAY_IMAGE_EXPIRY=$${QUAY_IMAGE_EXPIRY:-never}