Skip to content

Commit

Permalink
Set agent active to false on unenroll ack. (elastic#118)
Browse files Browse the repository at this point in the history
  • Loading branch information
blakerouse committed Mar 3, 2021
1 parent 17514a6 commit 0069815
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 0 deletions.
1 change: 1 addition & 0 deletions cmd/fleet/handleAck.go
Original file line number Diff line number Diff line change
Expand Up @@ -194,6 +194,7 @@ func _handleUnenroll(ctx context.Context, bulker bulk.Bulk, agent *model.Agent)
updates := make([]bulk.BulkOp, 0, 1)
now := time.Now().UTC().Format(time.RFC3339)
fields := map[string]interface{}{
dl.FieldActive: false,
dl.FieldUnenrolledAt: now,
dl.FieldUpdatedAt: now,
}
Expand Down
1 change: 1 addition & 0 deletions internal/pkg/dl/constants.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ const (
FieldPolicyRevisionIdx = "policy_revision_idx"
FieldPolicyCoordinatorIdx = "policy_coordinator_idx"

FieldActive = "active"
FieldUpdatedAt = "updated_at"
FieldUnenrolledAt = "unenrolled_at"
)
Expand Down

0 comments on commit 0069815

Please sign in to comment.