mirror of
https://github.com/kemko/nomad.git
synced 2026-01-11 04:45:42 +03:00
Fix upgrade path for created resources
This *might* be a fix for #2295 -- I've been unable to reproduce the bug. However, this guard seems wise regardless. I should never be overwriting an intialized created resources with a nil.
This commit is contained in:
@@ -247,9 +247,13 @@ func (r *TaskRunner) RestoreState() error {
|
||||
}
|
||||
r.artifactsDownloaded = snap.ArtifactDownloaded
|
||||
r.taskDirBuilt = snap.TaskDirBuilt
|
||||
r.createdResources = snap.CreatedResources
|
||||
r.payloadRendered = snap.PayloadRendered
|
||||
|
||||
// Pre-0.5.3 state snapshots won't have created resources
|
||||
if snap.CreatedResources != nil {
|
||||
r.createdResources = snap.CreatedResources
|
||||
}
|
||||
|
||||
if err := r.setTaskEnv(); err != nil {
|
||||
return fmt.Errorf("client: failed to create task environment for task %q in allocation %q: %v",
|
||||
r.task.Name, r.alloc.ID, err)
|
||||
|
||||
Reference in New Issue
Block a user