From 438f98c0f30ca6628773a215f81794fcd63e2686 Mon Sep 17 00:00:00 2001 From: Mahmood Ali Date: Tue, 28 Jan 2020 09:59:05 -0500 Subject: [PATCH] client: canonicalize alloc.Job on restore 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. --- client/state/state_database.go | 1 + 1 file changed, 1 insertion(+) diff --git a/client/state/state_database.go b/client/state/state_database.go index c513e13da39..6d1e65fb297 100644 --- a/client/state/state_database.go +++ b/client/state/state_database.go @@ -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) }