mirror of
https://github.com/kemko/nomad.git
synced 2026-01-08 19:35:41 +03:00
Only set deployment health if not already set
This commit is contained in:
@@ -1987,9 +1987,14 @@ func makeFailedAlloc(add *structs.Allocation, err error) *structs.Allocation {
|
||||
}
|
||||
|
||||
failTime := time.Now()
|
||||
stripped.DeploymentStatus = &structs.AllocDeploymentStatus{
|
||||
Healthy: helper.BoolToPtr(false),
|
||||
Timestamp: failTime,
|
||||
if add.DeploymentStatus.HasHealth() {
|
||||
// Never change deployment health once it has been set
|
||||
stripped.DeploymentStatus = add.DeploymentStatus.Copy()
|
||||
} else {
|
||||
stripped.DeploymentStatus = &structs.AllocDeploymentStatus{
|
||||
Healthy: helper.BoolToPtr(false),
|
||||
Timestamp: failTime,
|
||||
}
|
||||
}
|
||||
|
||||
taskGroup := add.Job.LookupTaskGroup(add.TaskGroup)
|
||||
|
||||
Reference in New Issue
Block a user