Skip to content

Commit

Permalink
removed ip from ingress
Browse files Browse the repository at this point in the history
  • Loading branch information
happytreees committed Aug 19, 2024
1 parent 9ce9e22 commit b3edc0f
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions vultr/loadbalancers.go
Original file line number Diff line number Diff line change
Expand Up @@ -123,13 +123,14 @@ func (l *loadbalancers) GetLoadBalancer(ctx context.Context, _ string, service *
hostname := lb.Label

// Check if hostname annotation is blank and set if not
if _, ok := service.Annotations[annoVultrHostname]; !ok {
if _, ok := service.Annotations[annoVultrHostname]; ok {
if service.Annotations[annoVultrHostname] != "" {
if govalidator.IsDNSName(service.Annotations[annoVultrHostname]) {
hostname = service.Annotations[annoVultrHostname]
} else {
return nil, true, fmt.Errorf("hostname %s is not a valid DNS name", service.Annotations[annoVultrHostname])
}
klog.Infof("setting hostname for loadbalancer to: %s", hostname)
ingress = append(ingress, v1.LoadBalancerIngress{Hostname: hostname})
}
} else {
Expand Down Expand Up @@ -213,13 +214,14 @@ func (l *loadbalancers) EnsureLoadBalancer(ctx context.Context, clusterName stri

hostname := lb2.Label

Check failure on line 215 in vultr/loadbalancers.go

View workflow job for this annotation

GitHub Actions / Golangci-Lint

ineffectual assignment to hostname (ineffassign)
// Check if hostname annotation is blank and set if not
if _, ok := service.Annotations[annoVultrHostname]; !ok {
if _, ok := service.Annotations[annoVultrHostname]; ok {
if service.Annotations[annoVultrHostname] != "" {
if govalidator.IsDNSName(service.Annotations[annoVultrHostname]) {
hostname = service.Annotations[annoVultrHostname]
} else {
return nil, fmt.Errorf("hostname %s is not a valid DNS name", service.Annotations[annoVultrHostname])
}
klog.Infof("setting hostname for loadbalancer to: %s", hostname)
ingress = append(ingress, v1.LoadBalancerIngress{Hostname: hostname})

}

Check failure on line 227 in vultr/loadbalancers.go

View workflow job for this annotation

GitHub Actions / Golangci-Lint

unnecessary trailing newline (whitespace)
Expand Down

0 comments on commit b3edc0f

Please sign in to comment.