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, - } - } -}