Skip to content

Commit ffa2b72

Browse files
committed
make: add DELETE_AFTER_PUSH flag
GHA has been seen to run out of space. Add a flag to delete local image after push. Signed-off-by: Jakob Naucke <jnaucke@redhat.com> Assisted-by: AI
1 parent 9ff048c commit ffa2b72

2 files changed

Lines changed: 21 additions & 7 deletions

File tree

.github/workflows/integration-tests.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ jobs:
6969
- name: "Create KinD cluster"
7070
run: make cluster-up
7171
- name: "Build and push images"
72-
run: make push
72+
run: make DELETE_AFTER_PUSH=true push
7373
- name: "Install KubeVirt"
7474
run: make install-kubevirt
7575
- name: "Run integration tests"

Makefile

Lines changed: 20 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,10 @@
33
#
44
# SPDX-License-Identifier: CC0-1.0
55

6-
.PHONY: all build build-tools crds-rs generate manifests cluster-up cluster-down image push install-trustee install clean fmt-check clippy lint test test-release release-tarball
6+
.PHONY: all build build-tools crds-rs generate manifests cluster-up cluster-down \
7+
install-trustee install clean fmt-check clippy lint test test-release release-tarball \
8+
operator-image compute-pcrs-image reg-server-image attestation-key-register-image image \
9+
push-operator push-compute-pcrs push-reg-server push-attestation-key-register push \
710

811
SHELL := /bin/bash
912

@@ -24,6 +27,7 @@ KOPIUM ?= $(LOCALBIN)/kopium-$(KOPIUM_VERSION)
2427
REGISTRY ?= quay.io/trusted-execution-clusters
2528
TAG ?= latest
2629
PUSH_FLAGS ?=
30+
DELETE_AFTER_PUSH ?= false
2731
OPERATOR_IMAGE ?= $(REGISTRY)/trusted-cluster-operator:$(TAG)
2832
COMPUTE_PCRS_IMAGE=$(REGISTRY)/compute-pcrs:$(TAG)
2933
REG_SERVER_IMAGE=$(REGISTRY)/registration-server:$(TAG)
@@ -113,11 +117,21 @@ attestation-key-register-image:
113117

114118
image: operator-image compute-pcrs-image reg-server-image attestation-key-register-image
115119

116-
push: image
117-
$(CONTAINER_CLI) push $(OPERATOR_IMAGE) $(PUSH_FLAGS)
118-
$(CONTAINER_CLI) push $(COMPUTE_PCRS_IMAGE) $(PUSH_FLAGS)
119-
$(CONTAINER_CLI) push $(REG_SERVER_IMAGE) $(PUSH_FLAGS)
120-
$(CONTAINER_CLI) push $(ATTESTATION_KEY_REGISTER_IMAGE) $(PUSH_FLAGS)
120+
define push-image
121+
$(CONTAINER_CLI) push $(1) $(PUSH_FLAGS)
122+
$(if $(filter true,$(DELETE_AFTER_PUSH)),$(CONTAINER_CLI) rmi $(1))
123+
endef
124+
125+
push-operator: operator-image
126+
$(call push-image,$(OPERATOR_IMAGE))
127+
push-compute-pcrs: compute-pcrs-image
128+
$(call push-image,$(COMPUTE_PCRS_IMAGE))
129+
push-reg-server: reg-server-image
130+
$(call push-image,$(REG_SERVER_IMAGE))
131+
push-attestation-key-register: attestation-key-register-image
132+
$(call push-image,$(ATTESTATION_KEY_REGISTER_IMAGE))
133+
134+
push: push-operator push-compute-pcrs push-reg-server push-attestation-key-register
121135

122136
release-tarball: manifests
123137
tar -cf trusted-execution-operator-$(TAG).tar config

0 commit comments

Comments
 (0)