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

Condition update and Event when SkipDrain are Completed/DrainSucceeded #72

Open
dbenque opened this issue Mar 30, 2020 · 0 comments
Open

Comments

@dbenque
Copy link
Contributor

dbenque commented Mar 30, 2020

If skipDrain flag is set the Drain activity is not performed and returns no error:
https://github.com/planetlabs/draino/blob/master/internal/kubernetes/drainer.go#L262

As a consequence the Drain activity that was schedule thinks that the Drain was successfully performed :
https://github.com/planetlabs/draino/blob/master/internal/kubernetes/drainSchedule.go#L129

and the condition is updated with Completed and an event is fired with DrainSucceeded:
https://github.com/planetlabs/draino/blob/master/internal/kubernetes/drainSchedule.go#L151-L154

What can be done:

  • Either (A) take into account the skipDrain at schedule time and just don't mark the node and don't plan any schedule
  • Or (B) return a specific error from drainer.Drain and check against this error to update the condition with Skipped instead of Completed and send a different type of event DrainSkipped

(B) is more code but a bit more verbose for the user, so I would be in favor of (B).

I can do the fix, what solution do you prefer?

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

No branches or pull requests

1 participant