From ae11add1af59ae552a10e6d7c8f7074d3c287f30 Mon Sep 17 00:00:00 2001 From: mperezd Date: Thu, 7 Mar 2024 08:02:08 +0100 Subject: [PATCH] Fixed types in AgentExecStatus struct (#123) * Fixed types in AgentExecStatus struct * Changed if stament to match type * Fixed identation in types.go --------- Co-authored-by: mperez --- types.go | 4 ++-- virtual_machine.go | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/types.go b/types.go index 7736c6f..53b7581 100644 --- a/types.go +++ b/types.go @@ -913,10 +913,10 @@ type AgentOsInfo struct { } type AgentExecStatus struct { - Exited bool `json:"exited"` + Exited int `json:"exited"` ErrData string `json:"err-data"` ErrTruncated bool `json:"err-truncated"` - ExitCode int `json:"exit-code"` + ExitCode int `json:"exitcode"` OutData string `json:"out-data"` OutTruncated string `json:"out-truncated"` Signal bool `json:"signal"` diff --git a/virtual_machine.go b/virtual_machine.go index 06b9038..e18c5fa 100644 --- a/virtual_machine.go +++ b/virtual_machine.go @@ -532,7 +532,7 @@ func (v *VirtualMachine) WaitForAgentExecExit(ctx context.Context, pid, seconds if err != nil { return nil, err } - if status.Exited { + if status.Exited != 0 { return status, nil }