Skip to content

Commit

Permalink
fix: FLB support IPv6 external address (#455)
Browse files Browse the repository at this point in the history
* fix: support IPv6 external address

Signed-off-by: Lin Yang <[email protected]>

* chore: prepare release v1.2.9-alpha.1

Signed-off-by: Lin Yang <[email protected]>

* Revert "chore: prepare release v1.2.9-alpha.1"

This reverts commit 23a5b7d.

---------

Signed-off-by: Lin Yang <[email protected]>
  • Loading branch information
reaver-flomesh authored Nov 21, 2024
1 parent 2c4f1a7 commit 1b2afe9
Showing 1 changed file with 13 additions and 14 deletions.
27 changes: 13 additions & 14 deletions pkg/controllers/flb/utils.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ package flb

import (
"fmt"
"net"
"strings"

"github.com/flomesh-io/fsm/pkg/constants"
Expand Down Expand Up @@ -36,20 +35,20 @@ func lbIPs(addresses []string) []string {
return nil
}

ips := make([]string, 0)
for _, addr := range addresses {
if strings.Contains(addr, ":") {
host, _, err := net.SplitHostPort(addr)
if err != nil {
return nil
}
ips = append(ips, host)
} else {
ips = append(ips, addr)
}
}
//ips := make([]string, 0)
//for _, addr := range addresses {
// if strings.Contains(addr, ":") {
// host, _, err := net.SplitHostPort(addr)
// if err != nil {
// return nil
// }
// ips = append(ips, host)
// } else {
// ips = append(ips, addr)
// }
//}

return ips
return addresses
}

func getValidAlgo(value string) string {
Expand Down

0 comments on commit 1b2afe9

Please sign in to comment.