Minor changes around running pods and catching error in infrastructure roles.
This commit is contained in:
parent
1f3730b2b4
commit
2aeaad03f3
|
|
@ -60,7 +60,9 @@ class K8s:
|
|||
'default', label_selector='name=postgres-operator'
|
||||
).items
|
||||
|
||||
if pods:
|
||||
pods = list(filter(lambda x: x.status.phase=='Running', pods))
|
||||
|
||||
if len(pods):
|
||||
return pods[0]
|
||||
|
||||
return None
|
||||
|
|
|
|||
|
|
@ -284,6 +284,7 @@ class EndToEndTestCase(unittest.TestCase):
|
|||
# operator configuration via API
|
||||
|
||||
def verify_role():
|
||||
try:
|
||||
operator_pod = k8s.get_operator_pod()
|
||||
get_config_cmd = "wget --quiet -O - localhost:8080/config"
|
||||
result = k8s.exec_with_kubectl(operator_pod.metadata.name, get_config_cmd)
|
||||
|
|
@ -306,6 +307,8 @@ class EndToEndTestCase(unittest.TestCase):
|
|||
"Origin": 2,
|
||||
})
|
||||
return True
|
||||
except:
|
||||
pass
|
||||
|
||||
return False
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue