Closed Programie closed 1 year ago
Hi, sorry for the inconvenience, this seems to be caused by https://github.com/ionos-cloud/ionosctl/blob/master/commands/cloudapi-v6/k8s_nodepool_lan.go#L355, specifically the address for the loop variable is reused in each loop iteration
I have no experience with Go (yet), but for me the code looks correct.
It is iterating over network
and the net
variable contains the network from the current iteration. But I could also be completely wrong.
Would be really helpful if that could be fixed soon. :+1:
EDIT: I guess the issue is caused by the &
in front of net
and gatewayIp[i]
as it is passing the value by-reference. So, removing the &
should fix the issue?
Description
I try to add multiple routes to a private LAN to be added to a Kubernetes node pool.
But instead of adding each network to the private LAN, only the last one is added multiple times.
Expected behavior
Each route should be added to the private LAN.
How to Reproduce
Create a new Kubernetes Cluster and add a Node Pool to it.
Add the private LAN (replace variables with the correct values):
The command is executed successfully, the verbose output also shows the correct networks to be added:
But the response at the end of the command shows the following in
RoutesNetwork
which is wrong (the same subnet is listed multiple times):References
This is related to #273 in which the ability to add multiple routes/networks to a single private LAN was implemented.