Skip to content

Commit

Permalink
docs: fix Plan{,Result}.NodeUpdate comment (#13534)
Browse files Browse the repository at this point in the history
It appears way back when this was first implemented in
9a91728, it was renamed from
NodeEvict (with a correct comment) to NodeUpdate. The comment was
changed from referring to only evictions to referring to "all allocs" in
the first sentence and "stop or evict" in the second.

This confuses every time I see it because I read the name (NodeUpdate)
and first sentence ("all the allocs") and assume this represents *all*
allocations... which isn't true.

I'm going to assume I'm the only one who doesn't read the 2nd sentence
and that's why this suboptimal wording has lasted 7 years, but can we
change it for my sake?
  • Loading branch information
schmichael authored Jun 30, 2022
1 parent c2428e1 commit 49270ed
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions nomad/structs/structs.go
Original file line number Diff line number Diff line change
Expand Up @@ -11145,8 +11145,8 @@ type Plan struct {
// of the plan by only including it once.
Job *Job

// NodeUpdate contains all the allocations for each node. For each node,
// this is a list of the allocations to update to either stop or evict.
// NodeUpdate contains all the allocations to be stopped or evicted for
// each node.
NodeUpdate map[string][]*Allocation

// NodeAllocation contains all the allocations for each node.
Expand Down Expand Up @@ -11373,7 +11373,7 @@ func (p *Plan) NormalizeAllocations() {

// PlanResult is the result of a plan submitted to the leader.
type PlanResult struct {
// NodeUpdate contains all the updates that were committed.
// NodeUpdate contains all the evictions and stops that were committed.
NodeUpdate map[string][]*Allocation

// NodeAllocation contains all the allocations that were committed.
Expand Down

0 comments on commit 49270ed

Please sign in to comment.