From c364732c0fb3ff8907eebac6ae8cd8bb0f4f79d1 Mon Sep 17 00:00:00 2001 From: Michael Dwan Date: Mon, 20 Apr 2020 16:13:33 -0500 Subject: [PATCH] fix panic while deleting CSI plugins for missing job (#7758) --- nomad/state/state_store.go | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/nomad/state/state_store.go b/nomad/state/state_store.go index 1084af6c6588..878f78f4ea24 100644 --- a/nomad/state/state_store.go +++ b/nomad/state/state_store.go @@ -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, }) - } } }