Skip to content

Commit

Permalink
client: canonicalize alloc.Job on restore
Browse files Browse the repository at this point in the history
There is a case for always canonicalizing alloc.Job field when
canonicalizing the alloc.  I'm less certain of implications though, and
the job canonicalize hasn't changed for a long time.

Here, we special case client restore from database as it's probably the
most relevant part.  When receiving an alloc from RPC, the data should
be fresh enough.
  • Loading branch information
Mahmood Ali committed Jan 28, 2020
1 parent 4813863 commit 438f98c
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions client/state/state_database.go
Original file line number Diff line number Diff line change
Expand Up @@ -209,6 +209,7 @@ 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

0 comments on commit 438f98c

Please sign in to comment.