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

improve the isdraning check for openshift #419

Merged

Conversation

SchSeba
Copy link
Collaborator

@SchSeba SchSeba commented Mar 15, 2023

there is a case where we annotate the node as draning because we took the leader but on OCP the machine config pool was doing some work so we wait for it. if in the specific stage that we wait for the MCP we reset the daemon the new pod will say that it doesn't need to pause the pool and just start a drain

and we will stuck the cluster if we have some PDB blocking for more then 1 node to drain

there is a case where we annotate the node as draning because we took the leader
but on OCP the machine config pool was doing some work so we wait for it.
if in the specific stage that we wait for the MCP we reset the daemon
the new pod will say that it doesn't need to pause the pool and just start a drain

and we will stuck the cluster if we have some PDB blocking for more then 1 node to drain

Signed-off-by: Sebastian Sch <sebassch@gmail.com>
@github-actions
Copy link

Thanks for your PR,
To run vendors CIs use one of:

  • /test-all: To run all tests for all vendors.
  • /test-e2e-all: To run all E2E tests for all vendors.
  • /test-e2e-nvidia-all: To run all E2E tests for NVIDIA vendor.

To skip the vendors CIs use one of:

  • /skip-all: To skip all tests for all vendors.
  • /skip-e2e-all: To skip all E2E tests for all vendors.
  • /skip-e2e-nvidia-all: To skip all E2E tests for NVIDIA vendor.
    Best regards.

@coveralls
Copy link

Pull Request Test Coverage Report for Build 4428919985

  • 0 of 7 (0.0%) changed or added relevant lines in 1 file are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage increased (+0.2%) to 25.782%

Changes Missing Coverage Covered Lines Changed/Added Lines %
pkg/daemon/daemon.go 0 7 0.0%
Totals Coverage Status
Change from base Build 4418252967: 0.2%
Covered Lines: 1954
Relevant Lines: 7579

💛 - Coveralls

@@ -580,6 +580,14 @@ func (dn *Daemon) nodeHasAnnotation(annoKey string, value string) bool {

func (dn *Daemon) isNodeDraining() bool {
if anno, ok := dn.node.Annotations[annoKey]; ok && (anno == annoDraining || anno == annoMcpPaused) {
// for openshift cluster draining should be true only if the annotation has MCP paused
if dn.openshiftContext.IsOpenshiftCluster() && !dn.openshiftContext.IsHypershift() {
if anno == annoMcpPaused {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I dont know how MCP Pause annot is being used so i cannot comment on the correctess of this and how it would affect all palces which call this method

but some comment about the style :)

you can check for annoDraining and drop the else.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @adrianchiris, I addressed your comment about style in:

I also added some unit tests to be sure we do not forget any use cases.
Can you please refer to that PR?

@SchSeba SchSeba merged commit e8b2db7 into k8snetworkplumbingwg:master Mar 23, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants