In the last PR to support OVN provider for LB, listener will refer to
load balancer provider for ACL settings. While currently get listener
API returns empty Pools, which will cause nil pointer dereference when
referring Pool.Loadbalancer.Provider.
This commit fix this issue by getting pool information with
DefaultPoolID when Pools is empty. As I added GetPool function, the
origin GetPool function is renamed to GetPoolMember.
This fixes an issue where kops picks the last server group found on
OpenStack instead of the right one when getting the cloud groups.
For example, lets assume that kops created those server groups and they are returned in the order as shown here by the OpenStack API:
```
cluster-name-bastion
cluster-name-cp-0
cluster-name-worker
````
Now kops looks for nodes associated with the IG "bastion" and the
expected behavior would be that it ends up using "cluster-name-bastion".
However, it will actually end up associating the cloud group with the
last server group, which is in this case "cluster-name-worker" due to
the reference switching to the last item when the loop is done.
In the worst case this could lead to kops deleting the wrong instances
when deleting an IG.
Not using the server group as a "by reference" argument when building
the cloud group fixes this behavior.
The overall goal is to get rid of the specific port names and replace
them with hashed ones. This in turn allows us to introduce rolling
updates for Openstack in a later stage.
This was our only reliance on cloud-provider-openstack which depends on k8s.io/kubernetes.
With the logic in-lined, kops no longer has any indirect dependencies of k/k
This PR introduces two fixes:
1) Add missing RetryWithBackoff to DeleteInstanceWithID
2) Fix broken retry logic in all other delete functions. In the current implementation, as the first Delete request will almost certainly return nil, the function will return true and the retry will not try again, resulting in assets not getting deleted from OpenStack
Also, the current writeBackoff is pretty aggressive and I introduced a bit less hasty deleteBackoff.
The change has been tested with OpenStack. I verified that all APIs we are hitting will eventually return the 404 (type) we are looking for.
It takes some seconds for the node to be created and the (fixed) ip, so we need to retry this operation.
Also need to increase the number of retries quite a bit in order to wait long enough.
Originally, floating ips depended on instances, but this causes a dependency cycle now that bootstrap scripts require all IPs for the API cert.
This also requires using networking API for creating floating ips instead of compute so that we can name (and later tag) the floating IPs, which is necessary to know which floating IP belongs to which instance prior to association