From 429144da2272a45fca0a83b0768768f8b4a4c725 Mon Sep 17 00:00:00 2001 From: Dean Sheather Date: Sun, 11 Feb 2024 21:01:16 -0800 Subject: [PATCH] fix: copy app ID in healthcheck (#12087) --- codersdk/agentsdk/convert.go | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/codersdk/agentsdk/convert.go b/codersdk/agentsdk/convert.go index 5b556fd688..3d46898d40 100644 --- a/codersdk/agentsdk/convert.go +++ b/codersdk/agentsdk/convert.go @@ -286,8 +286,11 @@ func ProtoFromAppHealthsRequest(req PostAppHealthsRequest) (*proto.BatchUpdateAp if !ok { return nil, xerrors.Errorf("unknown app health: %s", h) } + + var idCopy uuid.UUID + copy(idCopy[:], id[:]) pReq.Updates = append(pReq.Updates, &proto.BatchUpdateAppHealthRequest_HealthUpdate{ - Id: id[:], + Id: idCopy[:], Health: proto.AppHealth(hp), }) }