Skip to content

Commit

Permalink
WIP - signal Fleet warning on elastic-agent status
Browse files Browse the repository at this point in the history
  • Loading branch information
pchila committed Sep 11, 2023
1 parent bde5dd8 commit 2f06a5c
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions internal/pkg/fleetapi/checkin_cmd.go
Original file line number Diff line number Diff line change
Expand Up @@ -77,8 +77,9 @@ func (e *CheckinRequest) Validate() error {
// CheckinResponse is the response send back from the server which contains all the action that
// need to be executed or proxy to running processes.
type CheckinResponse struct {
AckToken string `json:"ack_token"`
Actions Actions `json:"actions"`
AckToken string `json:"ack_token"`
Actions Actions `json:"actions"`
FleetWarning string `json:"-"`
}

// Validate validates the response send from the server.
Expand Down Expand Up @@ -140,6 +141,7 @@ func (e *CheckinCmd) Execute(ctx context.Context, r *CheckinRequest) (*CheckinRe
}

checkinResponse := &CheckinResponse{}
checkinResponse.FleetWarning = resp.Header.Get("Warning")
decoder := json.NewDecoder(bytes.NewReader(rs))
if err := decoder.Decode(checkinResponse); err != nil {
return nil, sendDuration, errors.New(err,
Expand Down

0 comments on commit 2f06a5c

Please sign in to comment.