hako icon indicating copy to clipboard operation
hako copied to clipboard

Is it oposite condition?

Open mocyuto opened this issue 6 years ago • 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

mocyuto avatar Sep 06 '19 02:09 mocyuto

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 .

eagletmt avatar Sep 09 '19 07:09 eagletmt

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 https://github.com/eagletmt/hako/pull/80 means attach target group with hako prefix at existing load balancer, but I could be wrong.

mocyuto avatar Sep 12 '19 16:09 mocyuto