summaryrefslogtreecommitdiffstats
path: root/roles
diff options
context:
space:
mode:
authorClayton Coleman <ccoleman@redhat.com>2017-10-30 23:28:53 -0400
committerClayton Coleman <ccoleman@redhat.com>2017-10-30 23:31:02 -0400
commit971e224650387a873e01af29bf135f47ab2f6980 (patch)
treeef789fc6655ad3ed6a2b02e35604505f2bb0c54f /roles
parentd3730aa2dcd3f68513fe350e115e1a44e7c4c229 (diff)
downloadopenshift-971e224650387a873e01af29bf135f47ab2f6980.tar.gz
openshift-971e224650387a873e01af29bf135f47ab2f6980.tar.bz2
openshift-971e224650387a873e01af29bf135f47ab2f6980.tar.xz
openshift-971e224650387a873e01af29bf135f47ab2f6980.zip
Delete images located in a family named {{ prefix }}images
Allows CI jobs to create images specifically for this cluster and then remove them afterwards.
Diffstat (limited to 'roles')
-rw-r--r--roles/openshift_gcp/templates/remove.j2.sh9
1 files changed, 8 insertions, 1 deletions
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