update all wait_for_pod_failover functions
This commit is contained in:
		
							parent
							
								
									e6acfa2d5a
								
							
						
					
					
						commit
						578aa95e13
					
				| 
						 | 
					@ -469,6 +469,7 @@ class K8sBase:
 | 
				
			||||||
    def wait_for_pod_failover(self, failover_targets, labels, namespace='default'):
 | 
					    def wait_for_pod_failover(self, failover_targets, labels, namespace='default'):
 | 
				
			||||||
        pod_phase = 'Failing over'
 | 
					        pod_phase = 'Failing over'
 | 
				
			||||||
        new_pod_node = ''
 | 
					        new_pod_node = ''
 | 
				
			||||||
 | 
					        pods_with_update_flag = self.count_pods_with_rolling_update_flag(labels, namespace)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        while (pod_phase != 'Running') or (new_pod_node not in failover_targets):
 | 
					        while (pod_phase != 'Running') or (new_pod_node not in failover_targets):
 | 
				
			||||||
            pods = self.api.core_v1.list_namespaced_pod(namespace, label_selector=labels).items
 | 
					            pods = self.api.core_v1.list_namespaced_pod(namespace, label_selector=labels).items
 | 
				
			||||||
| 
						 | 
					@ -477,6 +478,10 @@ class K8sBase:
 | 
				
			||||||
                pod_phase = pods[0].status.phase
 | 
					                pod_phase = pods[0].status.phase
 | 
				
			||||||
            time.sleep(self.RETRY_TIMEOUT_SEC)
 | 
					            time.sleep(self.RETRY_TIMEOUT_SEC)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        while pods_with_update_flag != 0:
 | 
				
			||||||
 | 
					            pods_with_update_flag = self.count_pods_with_rolling_update_flag(labels, namespace)
 | 
				
			||||||
 | 
					            time.sleep(self.RETRY_TIMEOUT_SEC)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    def get_logical_backup_job(self, namespace='default'):
 | 
					    def get_logical_backup_job(self, namespace='default'):
 | 
				
			||||||
        return self.api.batch_v1_beta1.list_namespaced_cron_job(namespace, label_selector="application=spilo")
 | 
					        return self.api.batch_v1_beta1.list_namespaced_cron_job(namespace, label_selector="application=spilo")
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
		Reference in New Issue