Skip to content

Commit

Permalink
fixup: do not persist bundle Dockerfile changes for quay expiry label
Browse files Browse the repository at this point in the history
Signed-off-by: KevFan <chfan@redhat.com>
  • Loading branch information
KevFan committed Sep 10, 2024
1 parent 9dced5e commit e4f3ac3
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 7 deletions.
5 changes: 4 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -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 the QUAY_DOCKERFILE_LABEL block from bundle.Dockerfile (cross-platform)
@sed -i.bak '/# Quay image expiry/,+3d' bundle.Dockerfile && rm bundle.Dockerfile.bak

.PHONY: bundle-push
bundle-push: ## Push the bundle image.
Expand Down
5 changes: 0 additions & 5 deletions bundle.Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -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}
1 change: 0 additions & 1 deletion make/catalog.mk
Original file line number Diff line number Diff line change
Expand Up @@ -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}
Expand Down

0 comments on commit e4f3ac3

Please sign in to comment.