Skip to content
This repository has been archived by the owner on Jan 8, 2024. It is now read-only.

Commit

Permalink
Merge pull request #4811 from hashicorp/fix-ecs-server-install-interrupt
Browse files Browse the repository at this point in the history
Respecting context when installing the ECS server
  • Loading branch information
izaaklauer authored Jul 17, 2023
2 parents 4c146e1 + 3199ea9 commit 16bf13f
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
3 changes: 3 additions & 0 deletions .changelog/4811.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
```release-note:bug
plugin/aws-ecs: Allow cancelling server install command when waiting on health.
```
8 changes: 7 additions & 1 deletion internal/serverinstall/ecs.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ import (
"github.com/aws/aws-sdk-go/service/elbv2"
"github.com/aws/aws-sdk-go/service/resourcegroups"
"github.com/hashicorp/go-hclog"

"github.com/hashicorp/waypoint-plugin-sdk/terminal"
"github.com/hashicorp/waypoint/builtin/aws/utils"
"github.com/hashicorp/waypoint/internal/clicontext"
Expand Down Expand Up @@ -429,7 +430,12 @@ func (i *ECSInstaller) Launch(
break
}
}
time.Sleep(5 * time.Second)

select {
case <-time.After(5 * time.Second):
case <-ctx.Done():
return nil, ctx.Err()
}
}

if !healthy {
Expand Down

0 comments on commit 16bf13f

Please sign in to comment.