From 87b051199732fd087879c4a1293a9fb9f34df5c4 Mon Sep 17 00:00:00 2001 From: Christian Adams Date: Fri, 29 Jul 2022 16:38:04 -0400 Subject: [PATCH] Use new postgres pod label when migrating from old instance (#1005) --- roles/installer/tasks/migrate_data.yml | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/roles/installer/tasks/migrate_data.yml b/roles/installer/tasks/migrate_data.yml index a2ce51bb..576afc07 100644 --- a/roles/installer/tasks/migrate_data.yml +++ b/roles/installer/tasks/migrate_data.yml @@ -21,17 +21,12 @@ - name: Get the postgres pod information k8s_info: kind: Pod - namespace: '{{ ansible_operator_meta.namespace }}' - name: '{{ ansible_operator_meta.name }}-postgres-0' # using name to keep compatibility + namespace: "{{ ansible_operator_meta.namespace }}" + label_selectors: + - "{{ postgres_label_selector }}" field_selectors: - status.phase=Running register: postgres_pod - until: - - "postgres_pod['resources'] | length" - - "postgres_pod['resources'][0]['status']['phase'] == 'Running'" - - "postgres_pod['resources'][0]['status']['containerStatuses'][0]['ready'] == true" - delay: 5 - retries: 60 - name: Set the resource pod name as a variable. set_fact: