-
Notifications
You must be signed in to change notification settings - Fork 2k
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
Monitor drains from CLI by default but allow detaching #3948
Conversation
d36195c
to
3af0332
Compare
allow -detach like other commands
3af0332
to
14d76fc
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I like the watcher! Good job!
command/node_drain.go
Outdated
|
||
case !orig.DesiredTransition.ShouldMigrate() && a.DesiredTransition.ShouldMigrate(): | ||
// Alloc marked for migration | ||
msg = "draining" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
msg = "marked for migration"
command/node_drain.go
Outdated
// Alloc status has changed; output | ||
msg = fmt.Sprintf("status %s -> %s", orig.ClientStatus, a.ClientStatus) | ||
|
||
case !orig.DesiredTransition.ShouldMigrate() && a.DesiredTransition.ShouldMigrate(): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we add a case for the desired status changing and make that message, "draining"
case orig.ClientStatus != a.ClientStatus: | ||
// Alloc status has changed; output | ||
msg = fmt.Sprintf("status %s -> %s", orig.ClientStatus, a.ClientStatus) | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you add a case for NextAllocation != "" and then make the message, "replaced by allocation %q".
Also delay "node complete" after the node has been marked complete to capture a few more alloc events. There are other ways to implement this that could trade off correctness for responsiveness as technically a node is considered drained when all of its allocs have been marked to stop and not when they've actually stopped (which may not happen for a long time).
I'm going to lock this pull request because it has been closed for 120 days ⏳. This helps our maintainers find and focus on the active contributions. |
Output from 5c4ffd4:
Original output from 8b7b42c: