Skip to content

Commit

Permalink
Sequence numbers are now reported on agent run completion, waiting fo…
Browse files Browse the repository at this point in the history
…r next version of SDK
  • Loading branch information
HenryEstberg committed Sep 25, 2024
1 parent 680b218 commit d7f17d7
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 6 deletions.
3 changes: 3 additions & 0 deletions .changelog/165.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
```release-note:improvement
Waypoint: Action sequence numbers are now reported on agent run completion
```
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -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=
Expand Down
12 changes: 9 additions & 3 deletions internal/commands/waypoint/agent/run.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -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,
Expand Down

0 comments on commit d7f17d7

Please sign in to comment.