From 177a21b1d200802c0c8472d3c772c557c0cb3e50 Mon Sep 17 00:00:00 2001 From: Michael Schurter Date: Fri, 20 Dec 2019 11:09:17 -0800 Subject: [PATCH] nomad/state: remove dead upgrade path code It is uncalled so there hsould be no runtime changes. --- nomad/state/state_store.go | 38 -------------------------------------- 1 file changed, 38 deletions(-) diff --git a/nomad/state/state_store.go b/nomad/state/state_store.go index a04e824a0..9d915536d 100644 --- a/nomad/state/state_store.go +++ b/nomad/state/state_store.go @@ -3581,25 +3581,6 @@ func (s *StateStore) updateSummaryWithAlloc(index uint64, alloc *structs.Allocat return nil } -// addEphemeralDiskToTaskGroups adds missing EphemeralDisk objects to TaskGroups -func (s *StateStore) addEphemeralDiskToTaskGroups(job *structs.Job) { - for _, tg := range job.TaskGroups { - var diskMB int - for _, task := range tg.Tasks { - if task.Resources != nil { - diskMB += task.Resources.DiskMB - task.Resources.DiskMB = 0 - } - } - if tg.EphemeralDisk != nil { - continue - } - tg.EphemeralDisk = &structs.EphemeralDisk{ - SizeMB: diskMB, - } - } -} - // UpsertACLPolicies is used to create or update a set of ACL policies func (s *StateStore) UpsertACLPolicies(index uint64, policies []*structs.ACLPolicy) error { txn := s.db.Txn(true) @@ -4196,22 +4177,3 @@ func (r *StateRestore) SchedulerConfigRestore(schedConfig *structs.SchedulerConf } return nil } - -// addEphemeralDiskToTaskGroups adds missing EphemeralDisk objects to TaskGroups -func (r *StateRestore) addEphemeralDiskToTaskGroups(job *structs.Job) { - for _, tg := range job.TaskGroups { - if tg.EphemeralDisk != nil { - continue - } - var sizeMB int - for _, task := range tg.Tasks { - if task.Resources != nil { - sizeMB += task.Resources.DiskMB - task.Resources.DiskMB = 0 - } - } - tg.EphemeralDisk = &structs.EphemeralDisk{ - SizeMB: sizeMB, - } - } -}