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

Handle Upgrades and Alloc.TaskResources modification #6922

Merged
merged 9 commits into from
Jan 28, 2020
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
Prev Previous commit
Next Next commit
actually always canonicalize alloc.Job
alloc.Job may be stale as well and need to migrate it.  It does cost
extra cycles but should be negligible.
  • Loading branch information
Mahmood Ali committed Jan 15, 2020
commit 4813863215bab65e493147fc6c9fd34f0a78023f
1 change: 0 additions & 1 deletion client/state/state_database.go
Original file line number Diff line number Diff line change
Expand Up @@ -209,7 +209,6 @@ func (s *BoltStateDB) getAllAllocations(tx *boltdd.Tx) ([]*structs.Allocation, m

// Handle upgrade path
ae.Alloc.Canonicalize()
ae.Alloc.Job.Canonicalize()

allocs = append(allocs, ae.Alloc)
}
Expand Down
4 changes: 1 addition & 3 deletions nomad/structs/structs.go
Original file line number Diff line number Diff line change
Expand Up @@ -7661,9 +7661,7 @@ func (a *Allocation) Canonicalize() {
a.AllocatedResources = &ar
}

// TODO: Investigate if we should canonicalize the job
// it may be out of sync with respect to the original job
// a.Job.Canonicalize()
a.Job.Canonicalize()
}

func (a *Allocation) copyImpl(job bool) *Allocation {
Expand Down