Skip to content

Commit

Permalink
CSI: node drain should end once only plugins remain
Browse files Browse the repository at this point in the history
In #12324 we made it so that plugins wait until the node drain is
complete, as we do for system jobs. But we neglected to mark the node
drain as complete once only plugins (or system jobs) remaining, which
means that the node drain is left in a draining state until the
`deadline` time expires. This was incorrectly documented as expected
behavior in #12324.
  • Loading branch information
tgross committed May 2, 2022
1 parent 4d404b3 commit 58c9f5d
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
6 changes: 3 additions & 3 deletions nomad/drainer/draining_node.go
Original file line number Diff line number Diff line change
Expand Up @@ -66,9 +66,9 @@ func (n *drainingNode) IsDone() (bool, error) {
}

for _, alloc := range allocs {
// System jobs are only stopped after a node is done draining
// everything else, so ignore them here.
if alloc.Job.Type == structs.JobTypeSystem {
// System and plugin jobs are only stopped after a node is
// done draining everything else, so ignore them here.
if alloc.Job.Type == structs.JobTypeSystem || alloc.Job.IsPlugin() {
continue
}

Expand Down
2 changes: 1 addition & 1 deletion website/content/docs/commands/node/drain.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ capability.

- `-ignore-system`: Ignore system allows the drain to complete without
stopping system job allocations. By default system jobs (and CSI
plugins) are stopped last, after the `deadline` time has expired.
plugins) are stopped last.

- `-keep-ineligible`: Keep ineligible will maintain the node's scheduling
ineligibility even if the drain is being disabled. This is useful when an
Expand Down

0 comments on commit 58c9f5d

Please sign in to comment.