File tree Expand file tree Collapse file tree 1 file changed +10
-19
lines changed
Expand file tree Collapse file tree 1 file changed +10
-19
lines changed Original file line number Diff line number Diff line change @@ -38,25 +38,16 @@ def send_get_request(site_url):
3838def verify_pod_in_project (openshift_dyn_client , project , pod ):
3939 pod_name = pod
4040 logger .debug (f'Verify pod "{ pod } " in project "{ project } "' )
41- try :
42- pods = Pod .get (dyn_client = openshift_dyn_client , namespace = project )
43- for pod in pods :
44- logger .debug (f"Current pod: { pod .instance .metadata .name } " )
45- if pod .instance .metadata .name == pod_name :
46- logger .debug ("Pod name match!" )
47- for container in pod .instance .status .containerStatuses :
48- if container .state .terminated :
49- if (
50- container .state .terminated .reason
51- != Resource .Status .COMPLETED
52- ):
53- return False
54- elif not container .state .running :
55- return False
56- return True
57- return False
58- except StopIteration :
59- raise
41+ pod = Pod (client = openshift_dyn_client , namespace = project , name = pod_name )
42+ if pod .exists :
43+ for container in pod .instance .status .containerStatuses :
44+ if container .state .terminated :
45+ if container .state .terminated .reason != Resource .Status .COMPLETED :
46+ return False
47+ elif not container .state .running :
48+ return False
49+ return True
50+ return False
6051
6152
6253def verify_pod_by_deployment (openshift_dyn_client , project , deployment ):
You can’t perform that action at this time.
0 commit comments