-
Notifications
You must be signed in to change notification settings - Fork 3
Support for our dear friend ALB #13
Conversation
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 looks great to my 👀 , @aarthykc ! Left a few small comments. Any idea what Circle needs to be happy?
} | ||
|
||
function preFlightCheck(elbname, callback) { | ||
var q = queue(6); |
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.
We aren't expecting 6 things to happen at once, yeah? only 2?
q.defer(getELBName, elbname); | ||
q.defer(getALBName, elbname); | ||
q.awaitAll(function (err, data) { | ||
if (err) console.log('err', err); |
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.
We'll want to return this error to the callback -- this would be a legitimate error (ie anything not filtered out by LoadBalancerNotFound
)
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.
ugh, left over from debugging ! fixing :D
q.defer(getALBName, elbname); | ||
q.awaitAll(function (err, data) { | ||
if (err) console.log('err', err); | ||
data = data.filter(d => { return d; }); |
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.
=> 😊
var parameter = {Names: [elbname]}; | ||
elbv2.describeLoadBalancers(parameter, function (err, data) { | ||
if (err) { | ||
if (err.code === 'LoadBalancerNotFound') return callback(null, null); |
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.
[style] return callback(null, null)
can also be expressed as return callback()
|
||
tape('preflight check elb', function (assert) { | ||
preFlightCheck('elb', function (err, data) { | ||
if (err) console.log(err); |
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 should be an assertion: assert.ifError(err)
|
||
tape('preflight check alb', function (assert) { | ||
preFlightCheck('alb', function (err, data) { | ||
if (err) console.log(err); |
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.
same as ^^
@emilymcafee, fixed the tests + style issues ! Could you 👀 whenever you get a moment ? |
@aarthykc awesome ! Let's 🚢 |
Allows the user to give and ALB or ELB link and gives percentage split of all the requests for an
ELB/ALB
cc @emilymcafee, @yhahn