Skip to content

Commit ba5704f

Browse files
authored
Merge pull request #2122 from changlan/check-mesos-task-label
Fix Panic: Check whether Mesos task labels are available
2 parents a058406 + 25dc521 commit ba5704f

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

container/mesos/mesos_agent.go

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -113,8 +113,10 @@ func (s *state) fetchLabelsFromTask(exID string, labels map[string]string) error
113113
}
114114
}
115115

116-
for _, l := range t.Labels.Labels {
117-
labels[l.Key] = *l.Value
116+
if t.Labels != nil {
117+
for _, l := range t.Labels.Labels {
118+
labels[l.Key] = *l.Value
119+
}
118120
}
119121

120122
return nil

0 commit comments

Comments
 (0)