Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[PSUPCLPL-10121] fix expect_pods function #198

Merged
merged 1 commit into from
Jul 14, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions kubemarine/plugins/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -410,9 +410,7 @@ def expect_pods(cluster, pods, namespace=None, timeout=None, retries=None,
stdout_line_allowed = True

if stdout_line_allowed:
if 'Running' in stdout_line:
running_pods_stdout += stdout_line + '\n'
elif is_critical_state_in_stdout(cluster, stdout_line):
if is_critical_state_in_stdout(cluster, stdout_line):
cluster.log.verbose("Failed pod detected: %s\n" % stdout_line)

if not failure_found:
Expand All @@ -422,6 +420,9 @@ def expect_pods(cluster, pods, namespace=None, timeout=None, retries=None,
# just in case, skip the error a couple of times, what if it comes out of the failure state?
if failures > cluster.globals['pods']['allowed_failures']:
raise Exception('Pod entered a state of error, further proceeding is impossible')
else:
# we have to take into account any pod in not a critical state
running_pods_stdout += stdout_line + '\n'

pods_ready = False
if running_pods_stdout and running_pods_stdout != "" and "0/1" not in running_pods_stdout:
Expand Down