From 032ec425c2d1e5974c8cc40cd1316e09a9a5f7b7 Mon Sep 17 00:00:00 2001 From: Preetha Appan Date: Fri, 11 Jan 2019 08:49:31 -0600 Subject: [PATCH] Only set deployment health if not already set --- client/client.go | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/client/client.go b/client/client.go index 2f053cb3d..5477971ed 100644 --- a/client/client.go +++ b/client/client.go @@ -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)