Przeglądaj źródła

Delete images located in a family named {{ prefix }}images

Allows CI jobs to create images specifically for this cluster and then
remove them afterwards.
Clayton Coleman 7 lat temu
rodzic
commit
971e224650
1 zmienionych plików z 8 dodań i 1 usunięć
  1. 8 1
      roles/openshift_gcp/templates/remove.j2.sh

+ 8 - 1
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