Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
K
k3s
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Jacklull
k3s
Commits
cde7b584
Commit
cde7b584
authored
Jul 11, 2014
by
brendandburns
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #422 from claire921/use_splithostport
pkg/proxy: use net.SplitHostPort instead of strings.Split
parents
ee4ec2af
ba07dc80
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
4 deletions
+3
-4
roundrobbin.go
pkg/proxy/roundrobbin.go
+3
-4
No files found.
pkg/proxy/roundrobbin.go
View file @
cde7b584
...
@@ -23,7 +23,6 @@ import (
...
@@ -23,7 +23,6 @@ import (
"net"
"net"
"reflect"
"reflect"
"strconv"
"strconv"
"strings"
"sync"
"sync"
"github.com/GoogleCloudPlatform/kubernetes/pkg/api"
"github.com/GoogleCloudPlatform/kubernetes/pkg/api"
...
@@ -57,11 +56,11 @@ func (impl LoadBalancerRR) LoadBalance(service string, srcAddr net.Addr) (string
...
@@ -57,11 +56,11 @@ func (impl LoadBalancerRR) LoadBalance(service string, srcAddr net.Addr) (string
}
}
func
(
impl
LoadBalancerRR
)
IsValid
(
spec
string
)
bool
{
func
(
impl
LoadBalancerRR
)
IsValid
(
spec
string
)
bool
{
index
:=
strings
.
Index
(
spec
,
":"
)
_
,
port
,
err
:=
net
.
SplitHostPort
(
spec
)
if
index
==
-
1
{
if
err
!=
nil
{
return
false
return
false
}
}
value
,
err
:=
strconv
.
Atoi
(
spec
[
index
+
1
:
]
)
value
,
err
:=
strconv
.
Atoi
(
port
)
if
err
!=
nil
{
if
err
!=
nil
{
return
false
return
false
}
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment