-
Notifications
You must be signed in to change notification settings - Fork 330
Feature: status reporting for ALB releases #1567
Conversation
@@ -304,9 +315,145 @@ func (r *Releaser) Release( | |||
return &Release{ | |||
Url: "http://" + hostname, | |||
LoadBalancerArn: *lb.LoadBalancerArn, | |||
TargetGroupArn: target.Arn, | |||
Region: target.Region, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I needed the region to build the right client. Other plugins have this on their config. Not sure which pattern we prefer.
) (*sdk.StatusReport, error) { | ||
|
||
if release.Region == "" { | ||
log.Debug("Region is not available for this release. Unable to determine status.") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have a feeling that we might hit this case in the upgrade path, where someone upgrades a server then tries to promote a deployment that didn't encode the region?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This would be good to test, sounds like a correct assumption.
|
||
var health sdk.StatusReport_Health | ||
|
||
switch *tgHealth.TargetHealth.State { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Potentially a dangerous deference, but we seem to do it in other places and it's ok.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe leave a note above the switch?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I haven't fully tested this, but the basics look good.
|
||
var health sdk.StatusReport_Health | ||
|
||
switch *tgHealth.TargetHealth.State { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe leave a note above the switch?
84179b8
to
1391bf6
Compare
Also some logic simplification, conforming to protobuf naming convention, and improved terminal UI.
1391bf6
to
08277d6
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Code looks good to me! 🎉
This implements status reports for the aws alb releaser plugin. It waits briefly for the release's target group to finish initializing, then reports on the health of the targets.
A few caveats:
Tested with deployments from ec2 and lambda.