Skip to content

Commit

Permalink
remove ip from ingress
Browse files Browse the repository at this point in the history
  • Loading branch information
happytreees committed Aug 19, 2024
1 parent 0fbde40 commit 9ce9e22
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 11 deletions.
5 changes: 4 additions & 1 deletion docs/load-balancers.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,4 +37,7 @@ The annotations are listed below. Please note that all annotations listed below
| `node-count` | int | 1 | Number of LoadBalancer nodes to have. Only odd numbers are supported. |
| `create` | `true` or `false` | `true` | This is used to determine whether or not to create a Vultr loadbalancer |
| `label` | string | | Custom label for the Vultr Loadbalancer rather than the default generated name |
| `hostname` | string | | Custom domain to be used for the load balancer. Ex: `example.vultr.com`
| `hostname` | string | | Custom domain to be used for the load balancer. Ex: `example.vultr.com`



23 changes: 13 additions & 10 deletions vultr/loadbalancers.go
Original file line number Diff line number Diff line change
Expand Up @@ -130,13 +130,14 @@ func (l *loadbalancers) GetLoadBalancer(ctx context.Context, _ string, service *
} else {
return nil, true, fmt.Errorf("hostname %s is not a valid DNS name", service.Annotations[annoVultrHostname])
}
ingress = append(ingress, v1.LoadBalancerIngress{Hostname: hostname})
}
}

ingress = append(ingress, v1.LoadBalancerIngress{Hostname: hostname, IP: lb.IPV4})
} else {
ingress = append(ingress, v1.LoadBalancerIngress{Hostname: hostname, IP: lb.IPV4})

if enabledIPv6 {
ingress = append(ingress, v1.LoadBalancerIngress{Hostname: hostname, IP: lb.IPV6})
if enabledIPv6 {
ingress = append(ingress, v1.LoadBalancerIngress{Hostname: hostname, IP: lb.IPV6})
}
}

return &v1.LoadBalancerStatus{
Expand Down Expand Up @@ -219,13 +220,15 @@ func (l *loadbalancers) EnsureLoadBalancer(ctx context.Context, clusterName stri
} else {
return nil, fmt.Errorf("hostname %s is not a valid DNS name", service.Annotations[annoVultrHostname])
}
}
}
ingress = append(ingress, v1.LoadBalancerIngress{Hostname: hostname})

ingress = append(ingress, v1.LoadBalancerIngress{Hostname: hostname, IP: lb2.IPV4})
}

Check failure on line 225 in vultr/loadbalancers.go

View workflow job for this annotation

GitHub Actions / Golangci-Lint

unnecessary trailing newline (whitespace)
} else {
ingress = append(ingress, v1.LoadBalancerIngress{IP: lb2.IPV4})

if enabledIPv6 {
ingress = append(ingress, v1.LoadBalancerIngress{Hostname: hostname, IP: lb2.IPV6})
if enabledIPv6 {
ingress = append(ingress, v1.LoadBalancerIngress{IP: lb2.IPV6})
}
}

return &v1.LoadBalancerStatus{
Expand Down

0 comments on commit 9ce9e22

Please sign in to comment.