|
@@ -37,7 +37,7 @@ function teardown() {
|
|
|
# scale down {{ node_group.name }}
|
|
|
(
|
|
|
# performs a delete and scale down as one operation to ensure maximum parallelism
|
|
|
- if ! instances=$( gcloud --project "{{ openshift_gcp_project }}" compute instance-groups managed list-instances "{{ openshift_gcp_prefix }}ig-{{ node_group.suffix }}" --zone "{{ openshift_gcp_zone }}" --format='value[terminator=","](instance)' ); then
|
|
|
+ if ! instances=$( gcloud --project "{{ openshift_gcp_project }}" compute instance-groups managed list-instances "{{ openshift_gcp_prefix }}ig-{{ node_group.suffix }}" --zone "{{ openshift_gcp_zone }}" --format='value[terminator=","](instance)' 2>/dev/null ); then
|
|
|
exit 0
|
|
|
fi
|
|
|
instances="${instances%?}"
|
|
@@ -59,6 +59,15 @@ if gsutil ls -p "{{ openshift_gcp_project }}" "gs://{{ openshift_gcp_registry_bu
|
|
|
fi
|
|
|
) &
|
|
|
|
|
|
+# Project metadata prefixed with {{ openshift_gcp_prefix }}
|
|
|
+(
|
|
|
+ for key in $( gcloud --project "{{ openshift_gcp_project }}" compute project-info describe --flatten=commonInstanceMetadata.items[] '--format=value(commonInstanceMetadata.items.key)' ); do
|
|
|
+ if [[ "${key}" == "{{ openshift_gcp_prefix }}"* ]]; then
|
|
|
+ gcloud --project "{{ openshift_gcp_project }}" compute project-info remove-metadata "--keys=${key}"
|
|
|
+ fi
|
|
|
+ done
|
|
|
+) &
|
|
|
+
|
|
|
# DNS
|
|
|
(
|
|
|
dns_zone="{{ dns_managed_zone | default(openshift_gcp_prefix + 'managed-zone') }}"
|