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

Conversation

n549
Copy link
Collaborator

@n549 n549 commented Jul 11, 2022

Description

Sometimes expect:pods considers required pods ready even if some instances of these pods are not ready. Like in PSUPCLPL-10121 where calico-node pods were considered ready when only 8 our of 13 pods were really ready.
This can lead to different errors in the further work of kubemarine.

Fixes # (issue)
PSUPCLPL-10121

Solution

Looks like it happens due to the logic here: https://github.com/Netcracker/KubeMarine/blob/main/kubemarine/plugins/__init__.py#:~:text=if%20%27Running%27,is%20impossible%27)

We don't count pods in states like ContainerCreating, Init, etc (not Running and not critical states).

So it's better to change sequence of conditions like that:

if in critical_state:
  # count failure and raise exception if necessary
else:
 # add the pod to the line of pods to be checked

How to apply

none

Test Cases

Deploy/upgrade kubernetes with plugins. There shouldn't be errors and in the log for every expect_pods call the list of ready pods should contain all the instances of the required pods.

Checklist

  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • Integration CI passed
  • Unit tests. If Yes list of new/changed tests with brief description
  • There is no merge conflicts

Unit tests

Indicate new or changed unit tests and what they do, if any.

@n549 n549 added the bug Something isn't working label Jul 11, 2022
@koryaga koryaga merged commit bd3f93d into main Jul 14, 2022
@koryaga koryaga deleted the PSUPCLPL-10121_adjust_expect_pods branch July 14, 2022 12:06
@andrewluckyguy
Copy link
Collaborator

Fix checked from branch by QA

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants