cloudandheat / ch-k8s-lbaas

Flexible Loadbalancer-as-a-Service controller for Kubernetes
Apache License 2.0
9 stars 7 forks source link

Fix/get ports #29

Closed expektorans closed 2 years ago

expektorans commented 2 years ago

GetPorts: fix referencing of ports

This commit fixes the collection of ports by storing the actual item
instead of the address of the loop variable in the list. An example,
because I find pointers confusing:

Let's say our actual ports are [1, 2, 3]. Previously, GetPorts returned
[3, 3, 3], and now we receive (as expected) [1, 2, 3].

I stumbled over this problem while applying force to lbaas by having a
script create and delete services at random intervals as well as
manually deleting the lbaas and the workload pod. This should resolve
the resource leaks observed in #28. If we're lucky this might also help
with lbaas eating FIPs.