Merge pull request #6286 from hashicorp/b-inplaceupdate-bugfix
Fix inplace updates bug with group level networks
This commit is contained in:
commit
b460271de5
|
@ -509,9 +509,11 @@ func (s *GenericScheduler) computePlacements(destructive, place []placementResul
|
|||
AllocatedResources: resources,
|
||||
DesiredStatus: structs.AllocDesiredStatusRun,
|
||||
ClientStatus: structs.AllocClientStatusPending,
|
||||
// SharedResources is considered deprecated, will be removed in 0.11.
|
||||
// It is only set for compat reasons.
|
||||
SharedResources: &structs.Resources{
|
||||
DiskMB: tg.EphemeralDisk.SizeMB,
|
||||
Networks: tg.Networks,
|
||||
Networks: resources.Shared.Networks,
|
||||
},
|
||||
}
|
||||
|
||||
|
|
|
@ -363,9 +363,11 @@ func (s *SystemScheduler) computePlacements(place []allocTuple) error {
|
|||
AllocatedResources: resources,
|
||||
DesiredStatus: structs.AllocDesiredStatusRun,
|
||||
ClientStatus: structs.AllocClientStatusPending,
|
||||
// SharedResources is considered deprecated, will be removed in 0.11.
|
||||
// It is only set for compat reasons
|
||||
SharedResources: &structs.Resources{
|
||||
DiskMB: missing.TaskGroup.EphemeralDisk.SizeMB,
|
||||
Networks: missing.TaskGroup.Networks,
|
||||
Networks: resources.Shared.Networks,
|
||||
},
|
||||
}
|
||||
|
||||
|
|
|
@ -822,7 +822,7 @@ func genericAllocUpdateFn(ctx Context, stack Stack, evalID string) allocUpdateTy
|
|||
networks = tr.Networks
|
||||
}
|
||||
|
||||
// Add thhe networks back
|
||||
// Add the networks back
|
||||
resources.Networks = networks
|
||||
}
|
||||
|
||||
|
@ -837,8 +837,11 @@ func genericAllocUpdateFn(ctx Context, stack Stack, evalID string) allocUpdateTy
|
|||
newAlloc.AllocatedResources = &structs.AllocatedResources{
|
||||
Tasks: option.TaskResources,
|
||||
Shared: structs.AllocatedSharedResources{
|
||||
DiskMB: int64(newTG.EphemeralDisk.SizeMB),
|
||||
Networks: newTG.Networks,
|
||||
DiskMB: int64(newTG.EphemeralDisk.SizeMB),
|
||||
// Since this is an inplace update, we should copy network
|
||||
// information from the original alloc. This is similar to
|
||||
// how we copy network info for task level networks above.
|
||||
Networks: existing.AllocatedResources.Shared.Networks,
|
||||
},
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue