Skip to content

Commit

Permalink
fix panic while deleting CSI plugins for missing job (#7758)
Browse files Browse the repository at this point in the history
  • Loading branch information
michaeldwan committed Apr 20, 2020
1 parent 0017601 commit c364732
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions nomad/state/state_store.go
Original file line number Diff line number Diff line change
Expand Up @@ -1187,15 +1187,14 @@ func (s *StateStore) deleteJobFromPlugin(index uint64, txn *memdb.Txn, job *stru
plugins := map[string]*structs.CSIPlugin{}

for _, a := range allocs {
tg := job.LookupTaskGroup(a.TaskGroup)
// if its nil, we can just panic
tg := a.Job.LookupTaskGroup(a.TaskGroup)
for _, t := range tg.Tasks {
if t.CSIPluginConfig != nil {
plugAllocs = append(plugAllocs, &pair{
pluginID: t.CSIPluginConfig.ID,
alloc: a,
})

}
}
}
Expand Down

0 comments on commit c364732

Please sign in to comment.