diff options
author | Clayton Coleman <ccoleman@redhat.com> | 2017-10-30 23:28:53 -0400 |
---|---|---|
committer | Clayton Coleman <ccoleman@redhat.com> | 2017-10-30 23:31:02 -0400 |
commit | 971e224650387a873e01af29bf135f47ab2f6980 (patch) | |
tree | ef789fc6655ad3ed6a2b02e35604505f2bb0c54f /roles/openshift_gcp | |
parent | d3730aa2dcd3f68513fe350e115e1a44e7c4c229 (diff) | |
download | openshift-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/openshift_gcp')
-rw-r--r-- | roles/openshift_gcp/templates/remove.j2.sh | 9 |
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 |