vmware / cloud-provider-for-cloud-director

Kubernetes External Cloud Provider for VMware Cloud Director
Other
20 stars 30 forks source link

[VKCI-294] Reserve Ip from Ip Space during Load Balancer creation #347

Closed rocknes closed 9 months ago

rocknes commented 9 months ago

Added methods: reserveIpForLoadBalancer in gateway.go getLoadBalancerIpClaimMarker in loadbalancer.go

Updated methods: createLoadBalancer in loadbalancer.go CreateLoadBalancer in gateway.go

to enable reserving Ip for load balancers from Ip Spaces if the gateway supports it.


This change is Reviewable

ltimothy7 commented 9 months ago

pkg/vcdsdk/gateway.go line 2191 at r1 (raw file):


      ipSpaceAllocation, err := gm.FindIpAllocationByIp(ipSpace, allocatedIp)
      if err != nil || ipSpaceAllocation == nil {

For my understanding, if the ipSpaceAllocation is nil why is this is an error? I'm wondering why the next ipSpace shouldn't be used