diff --git a/.changelog/165.txt b/.changelog/165.txt new file mode 100644 index 00000000..35a0eae8 --- /dev/null +++ b/.changelog/165.txt @@ -0,0 +1,3 @@ +```release-note:improvement +Waypoint: Action sequence numbers are now reported on agent run completion +``` diff --git a/go.mod b/go.mod index 6f03b424..55444bff 100644 --- a/go.mod +++ b/go.mod @@ -12,7 +12,7 @@ require ( github.com/hashicorp/go-multierror v1.1.1 github.com/hashicorp/go-version v1.6.0 github.com/hashicorp/hcl/v2 v2.19.1 - github.com/hashicorp/hcp-sdk-go v0.104.0 + github.com/hashicorp/hcp-sdk-go v0.114.0 github.com/lithammer/dedent v1.1.0 github.com/manifoldco/promptui v0.9.0 github.com/mitchellh/cli v1.1.5 diff --git a/go.sum b/go.sum index 816385d5..a63b22cf 100644 --- a/go.sum +++ b/go.sum @@ -95,8 +95,8 @@ github.com/hashicorp/go-version v1.6.0 h1:feTTfFNnjP967rlCxM/I9g701jU+RN74YKx2mO github.com/hashicorp/go-version v1.6.0/go.mod h1:fltr4n8CU8Ke44wwGCBoEymUuxUHl09ZGVZPK5anwXA= github.com/hashicorp/hcl/v2 v2.19.1 h1://i05Jqznmb2EXqa39Nsvyan2o5XyMowW5fnCKW5RPI= github.com/hashicorp/hcl/v2 v2.19.1/go.mod h1:ThLC89FV4p9MPW804KVbe/cEXoQ8NZEh+JtMeeGErHE= -github.com/hashicorp/hcp-sdk-go v0.104.0 h1:uKAgAzXdjb+JgLgoT0Ta1/N/NEYTyCBHZUrknhJsBsQ= -github.com/hashicorp/hcp-sdk-go v0.104.0/go.mod h1:vQ4fzdL1AmhIAbCw+4zmFe5Hbpajj3NvRWkJoVuxmAk= +github.com/hashicorp/hcp-sdk-go v0.114.0 h1:OQno/I9UGEplkDzBBo04C1XUYHkWIU9g/+W2jWqZWGw= +github.com/hashicorp/hcp-sdk-go v0.114.0/go.mod h1:vQ4fzdL1AmhIAbCw+4zmFe5Hbpajj3NvRWkJoVuxmAk= github.com/huandu/xstrings v1.3.1/go.mod h1:y5/lhBue+AyNmUVz9RLU9xbLR0o4KIIExikq4ovT0aE= github.com/huandu/xstrings v1.3.2/go.mod h1:y5/lhBue+AyNmUVz9RLU9xbLR0o4KIIExikq4ovT0aE= github.com/huandu/xstrings v1.3.3/go.mod h1:y5/lhBue+AyNmUVz9RLU9xbLR0o4KIIExikq4ovT0aE= diff --git a/internal/commands/waypoint/agent/run.go b/internal/commands/waypoint/agent/run.go index be576f0a..17076c17 100644 --- a/internal/commands/waypoint/agent/run.go +++ b/internal/commands/waypoint/agent/run.go @@ -154,8 +154,9 @@ func runOp( ns string, ) { var ( - status string - statusCode int + status string + statusCode int + sequenceNum string ) log = log.With("group", ao.Group, "operation", ao.ID, "action-run-id", ao.ActionRunID) @@ -175,8 +176,13 @@ func runOp( if err != nil { log.Error("unable to register action as starting", "error", err) } else { + if resp != nil { + if resp.Payload != nil { + sequenceNum = resp.Payload.Sequence + } + } defer func() { - log.Info("reporting action run ended", "status", status, "status-code", statusCode) + log.Info("reporting action run ended", "status", status, "status-code", statusCode, "sequence", sequenceNum) _, err = opts.WS.WaypointServiceEndingAction(&waypoint_service.WaypointServiceEndingActionParams{ NamespaceID: ns,