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
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
8 changes: 8 additions & 0 deletions pkg/daemon/daemon.go
Original file line number Diff line number Diff line change
Expand Up @@ -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?

return true
} else {
return false
}
}
return true
}
return false
Expand Down