hashicorp / waypoint

A tool to build, deploy, and release any application on any platform.
https://waypointproject.io
Other
4.76k stars 327 forks source link

AWS ECS releaser reports empty target group as healthy #4900

Open pcjun97 opened 1 year ago

pcjun97 commented 1 year ago

Describe the bug The releaser for AWS ECS plugin checks for unhealthy targets in a target group, but reports healthy if there is no target in the target group at all. The deploy step does not wait for the tasks to be in "running" state before moving to the release step, which at that point in time the tasks (which are in "pending" state) has yet to be registered as targets in the new target group.

Steps to Reproduce Run waypoint deploy with aws-ecs apps.

project = "example"

app "httpbin" {
  build {
    use "docker-pull" {
      image = "kennethreitz/httpbin"
    }
  }

  deploy {
    use "aws-ecs" {
      ...
    }
  }
}

Despite the ECS task is still starting up and the target group being empty, the release step will reports all targets are healthy:

» Releasing...

» Performing operation locally
-> Running release v383
-> Initializing release...
-> Release initialized
-> Checking that all targets are healthy...
-> All targets are healthy!
-> Modifying load balancer to introduce new target group <REDACTED>
-> Finished ECS release

Expected behavior The releaser should treat a target group with no targets as "unhealthy", and report that accordingly.

Waypoint Platform Versions Additional version and platform information to help triage the issue if applicable:

Additional context Relevant code snippet: https://github.com/hashicorp/waypoint/blob/d65a8d95289eb172cb07c21e8a99581ca250352e/builtin/aws/ecs/releaser.go#L147-L158