diff --git a/internal/pkg/api/handleAck.go b/internal/pkg/api/handleAck.go index 58b66fa83..1261d8f6c 100644 --- a/internal/pkg/api/handleAck.go +++ b/internal/pkg/api/handleAck.go @@ -429,6 +429,7 @@ func (ack *AckT) handleUpgrade(ctx context.Context, zlog zerolog.Logger, agent * doc := bulk.UpdateFields{ dl.FieldUpgradeStartedAt: nil, dl.FieldUpgradedAt: now, + dl.FieldUpgradeStatus: "completed", } body, err := doc.Marshal() diff --git a/internal/pkg/dl/constants.go b/internal/pkg/dl/constants.go index ef7c5567c..034c23541 100644 --- a/internal/pkg/dl/constants.go +++ b/internal/pkg/dl/constants.go @@ -49,6 +49,7 @@ const ( FieldUnenrolledAt = "unenrolled_at" FieldUpgradedAt = "upgraded_at" FieldUpgradeStartedAt = "upgrade_started_at" + FieldUpgradeStatus = "upgrade_status" FieldDecodedSha256 = "decoded_sha256" FieldIdentifier = "identifier" diff --git a/internal/pkg/model/schema.go b/internal/pkg/model/schema.go index 18abc0883..5d3c844f1 100644 --- a/internal/pkg/model/schema.go +++ b/internal/pkg/model/schema.go @@ -139,7 +139,7 @@ type Agent struct { // Date/time the Elastic Agent checked in last time LastCheckin string `json:"last_checkin,omitempty"` - // Lst checkin status + // Last checkin status LastCheckinStatus string `json:"last_checkin_status,omitempty"` // Date/time the Elastic Agent was last updated @@ -190,6 +190,9 @@ type Agent struct { // Date/time the Elastic Agent started the current upgrade UpgradeStartedAt string `json:"upgrade_started_at,omitempty"` + // Upgrade status + UpgradeStatus string `json:"upgrade_status,omitempty"` + // Date/time the Elastic Agent was last upgraded UpgradedAt string `json:"upgraded_at,omitempty"` diff --git a/model/schema.json b/model/schema.json index 824ccfc05..423cfe3fc 100644 --- a/model/schema.json +++ b/model/schema.json @@ -459,6 +459,10 @@ "type": "string", "format": "date-time" }, + "upgrade_status": { + "description": "Upgrade status", + "type": "string" + }, "access_api_key_id": { "description": "ID of the API key the Elastic Agent must used to contact Fleet Server", "type": "string" @@ -509,7 +513,7 @@ "format": "date-time" }, "last_checkin_status": { - "description": "Lst checkin status", + "description": "Last checkin status", "type": "string" }, "default_api_key_id": {