eagletmt/hako

Is it oposite condition?

Closed this issue · 2 comments

This condition represent config doesn't have load_balancer_name key, so I think it would be oposite condition.

if !load_balancer_given?
https://github.com/eagletmt/hako/blob/master/lib/hako/schedulers/ecs_elb_v2.rb#L54

And also it is the same pattern at target group section
https://github.com/eagletmt/hako/blob/master/lib/hako/schedulers/ecs_elb_v2.rb#L81

So... what is your suggested change that you think is correct? I'd like to hear explanation like "with this Jsonnet file, I expect XXX, but actually got YYY".

My intended behavior is also expressed in the example file in #80 .

Sorry for my lack of explanation...

Using below condition, it couldn't create load balancer newly when load balancer name is given.

!load_balancer_given? && !load_balancer
It means "no load balancer name in config" and "no load balancer created", doesn't it.
And, it can create load balancer only "no load balancer name in config".

So, I expected unless load_balancer, but actually got !load_balancer_given? && !load_balancer
Because, it just create load balancer in this condition not attach target group.

I expected like below

  • no LB config && no load balancer => create hako prefix LB
  • with LB config && no load balancer => create LB with config name
  • with LB config && load balancer exist => do nothing

https://github.com/eagletmt/hako/blob/master/lib/hako/schedulers/ecs_elb_v2.rb#L54

At target group condition is the same as load balancer, because it just create target group not attach to load balancer.

supplement: I thought #80 means attach target group with hako prefix at existing load balancer, but I could be wrong.