mirror of
https://github.com/kemko/nomad.git
synced 2026-01-06 10:25:42 +03:00
client: fix panic from 0.8 -> 0.10 upgrade
makeAllocTaskServices did not do a nil check on AllocatedResources which causes a panic when upgrading directly from 0.8 to 0.10. While skipping 0.9 is not supported we intend to fix serious crashers caused by such upgrades to prevent cluster outages. I did a quick audit of the client package and everywhere else that accesses AllocatedResources appears to be properly guarded by a nil check.
This commit is contained in:
@@ -301,7 +301,7 @@ func NewTaskRunner(config *Config) (*TaskRunner, error) {
|
||||
}
|
||||
tr.taskResources = tres
|
||||
} else {
|
||||
// COMPAT(0.10): Upgrade from old resources to new resources
|
||||
// COMPAT(0.11): Upgrade from 0.8 resources to 0.9+ resources
|
||||
// Grab the old task resources
|
||||
oldTr, ok := tr.alloc.TaskResources[tr.taskName]
|
||||
if !ok {
|
||||
|
||||
Reference in New Issue
Block a user