Skip to content

Commit

Permalink
(from AES) Use kubectl wait for pod status instead of polling with exec
Browse files Browse the repository at this point in the history
  • Loading branch information
esmet committed Apr 8, 2021
1 parent d80a5b1 commit 1135121
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions python/kat/harness.py
Original file line number Diff line number Diff line change
Expand Up @@ -1572,12 +1572,12 @@ def _setup_k8s(self, selected):
retries=5, sleep_seconds=10):
raise RuntimeError('Could not apply manifest for KAT pod')

tries_left = 10
tries_left = 3
time.sleep(1)

while True:
if ShellCommand.run("check for KAT pod",
'kubectl', 'exec', '-n', 'default', 'kat', 'echo', 'hello'):
if ShellCommand.run("wait for KAT pod",
'kubectl', '-n', 'default', 'wait', '--timeout=30s', '--for=condition=Ready', 'pod', 'kat'):
print("KAT pod ready")
break

Expand Down Expand Up @@ -1605,12 +1605,12 @@ def _setup_k8s(self, selected):
retries=5, sleep_seconds=10):
raise RuntimeError('Could not apply manifest for dummy pod')

tries_left = 10
tries_left = 3
time.sleep(1)

while True:
if ShellCommand.run("check for dummy pod",
'kubectl', 'exec', '-n', 'default', 'dummy-pod', 'echo', 'hello'):
if ShellCommand.run("wait for dummy pod",
'kubectl', '-n', 'default', 'wait', '--timeout=30s', '--for=condition=Ready', 'pod', 'dummy-pod'):
print("Dummy pod ready")
break

Expand Down

0 comments on commit 1135121

Please sign in to comment.