handle ipv6 addresses

This commit is contained in:
Chris Lu
2021-09-07 16:43:54 -07:00
parent 35c8ea495f
commit 0128239c0f
16 changed files with 42 additions and 20 deletions

View File

@@ -2,6 +2,7 @@ package operation
import (
"fmt"
"github.com/chrislusf/seaweedfs/weed/util"
"strconv"
"strings"
@@ -35,7 +36,7 @@ func toVolumeServerGrpcAddress(volumeServer string) (grpcAddress string, err err
glog.Errorf("failed to parse volume server address: %v", volumeServer)
return "", err
}
return fmt.Sprintf("%s:%d", volumeServer[0:sepIndex], port+10000), nil
return util.JoinHostPort(volumeServer[0:sepIndex], port+10000), nil
}
func WithMasterServerClient(masterServer string, grpcDialOption grpc.DialOption, fn func(masterClient master_pb.SeaweedClient) error) error {