Merge pull request #6888 from hashicorp/r-remove-dead-disk-code

nomad/state: remove dead upgrade path code
This commit is contained in:
Michael Schurter 2019-12-20 14:36:28 -08:00 committed by GitHub
commit eb577f0e6c
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

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