From 971e224650387a873e01af29bf135f47ab2f6980 Mon Sep 17 00:00:00 2001 From: Clayton Coleman Date: Mon, 30 Oct 2017 23:28:53 -0400 Subject: Delete images located in a family named {{ prefix }}images Allows CI jobs to create images specifically for this cluster and then remove them afterwards. --- roles/openshift_gcp/templates/remove.j2.sh | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'roles') diff --git a/roles/openshift_gcp/templates/remove.j2.sh b/roles/openshift_gcp/templates/remove.j2.sh index fdc96d229..10b463349 100644 --- a/roles/openshift_gcp/templates/remove.j2.sh +++ b/roles/openshift_gcp/templates/remove.j2.sh @@ -161,5 +161,12 @@ for i in `jobs -p`; do wait $i; done for i in `jobs -p`; do wait $i; done +# Images specifically located under this cluster prefix family +for name in $( gcloud --project "{{ openshift_gcp_project }}" compute images list "--filter=family={{ openshift_gcp_prefix }}images" '--format=value(name)' ); do + ( gcloud --project "{{ openshift_gcp_project }}" compute images delete "${name}" ) & +done + # Network -teardown "{{ openshift_gcp_network_name }}" compute networks +( teardown "{{ openshift_gcp_network_name }}" compute networks ) & + +for i in `jobs -p`; do wait $i; done \ No newline at end of file -- cgit v1.2.3