From 5af7b0fe5ff6d19e057ff35237ec111b5c50aa9b Mon Sep 17 00:00:00 2001 From: Tim Gross Date: Mon, 6 Apr 2020 09:42:27 -0400 Subject: [PATCH] scheduler: prevent a reported NPE for CSI (#7633) --- scheduler/feasible.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scheduler/feasible.go b/scheduler/feasible.go index c3cedf5ac..848764443 100644 --- a/scheduler/feasible.go +++ b/scheduler/feasible.go @@ -304,7 +304,7 @@ func (c *CSIVolumeChecker) hasPlugins(n *structs.Node) (bool, string) { // Check the blocking allocations to see if they belong to this job for id := range vol.WriteAllocs { a, err := c.ctx.State().AllocByID(ws, id) - if err != nil || a.Namespace != c.namespace || a.JobID != c.jobID { + if err != nil || a == nil || a.Namespace != c.namespace || a.JobID != c.jobID { return false, fmt.Sprintf(FilterConstraintCSIVolumeInUseTemplate, vol.ID) } }