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
79778288
Commit
79778288
authored
Nov 22, 2017
by
Tim Hockin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix NewProxyServer
Different OSes need different args. This is not a great fix, but better than adding an arg to Windows which doesn't need it.
parent
c45820f0
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
18 additions
and
4 deletions
+18
-4
server.go
cmd/kube-proxy/app/server.go
+1
-1
server_others.go
cmd/kube-proxy/app/server_others.go
+11
-1
server_test.go
cmd/kube-proxy/app/server_test.go
+1
-1
server_windows.go
cmd/kube-proxy/app/server_windows.go
+5
-1
No files found.
cmd/kube-proxy/app/server.go
View file @
79778288
...
@@ -218,7 +218,7 @@ func (o *Options) Run() error {
...
@@ -218,7 +218,7 @@ func (o *Options) Run() error {
return
o
.
writeConfigFile
()
return
o
.
writeConfigFile
()
}
}
proxyServer
,
err
:=
NewProxyServer
(
o
.
config
,
o
.
CleanupAndExit
,
o
.
CleanupIPVS
,
o
.
scheme
,
o
.
master
)
proxyServer
,
err
:=
NewProxyServer
(
o
)
if
err
!=
nil
{
if
err
!=
nil
{
return
err
return
err
}
}
...
...
cmd/kube-proxy/app/server_others.go
View file @
79778288
...
@@ -54,7 +54,17 @@ import (
...
@@ -54,7 +54,17 @@ import (
)
)
// NewProxyServer returns a new ProxyServer.
// NewProxyServer returns a new ProxyServer.
func
NewProxyServer
(
config
*
proxyconfigapi
.
KubeProxyConfiguration
,
cleanupAndExit
bool
,
cleanupIPVS
bool
,
scheme
*
runtime
.
Scheme
,
master
string
)
(
*
ProxyServer
,
error
)
{
func
NewProxyServer
(
o
*
Options
)
(
*
ProxyServer
,
error
)
{
return
newProxyServer
(
o
.
config
,
o
.
CleanupAndExit
,
o
.
CleanupIPVS
,
o
.
scheme
,
o
.
master
)
}
func
newProxyServer
(
config
*
proxyconfigapi
.
KubeProxyConfiguration
,
cleanupAndExit
bool
,
cleanupIPVS
bool
,
scheme
*
runtime
.
Scheme
,
master
string
)
(
*
ProxyServer
,
error
)
{
if
config
==
nil
{
if
config
==
nil
{
return
nil
,
errors
.
New
(
"config is required"
)
return
nil
,
errors
.
New
(
"config is required"
)
}
}
...
...
cmd/kube-proxy/app/server_test.go
View file @
79778288
...
@@ -162,7 +162,7 @@ func TestProxyServerWithCleanupAndExit(t *testing.T) {
...
@@ -162,7 +162,7 @@ func TestProxyServerWithCleanupAndExit(t *testing.T) {
}
}
options
.
CleanupAndExit
=
true
options
.
CleanupAndExit
=
true
proxyserver
,
err
:=
NewProxyServer
(
options
.
config
,
options
.
CleanupAndExit
,
options
.
CleanupIPVS
,
options
.
scheme
,
options
.
master
)
proxyserver
,
err
:=
NewProxyServer
(
options
)
assert
.
Nil
(
t
,
err
,
"unexpected error in NewProxyServer, addr: %s"
,
addr
)
assert
.
Nil
(
t
,
err
,
"unexpected error in NewProxyServer, addr: %s"
,
addr
)
assert
.
NotNil
(
t
,
proxyserver
,
"nil proxy server obj, addr: %s"
,
addr
)
assert
.
NotNil
(
t
,
proxyserver
,
"nil proxy server obj, addr: %s"
,
addr
)
...
...
cmd/kube-proxy/app/server_windows.go
View file @
79778288
...
@@ -46,7 +46,11 @@ import (
...
@@ -46,7 +46,11 @@ import (
)
)
// NewProxyServer returns a new ProxyServer.
// NewProxyServer returns a new ProxyServer.
func
NewProxyServer
(
config
*
proxyconfigapi
.
KubeProxyConfiguration
,
cleanupAndExit
bool
,
scheme
*
runtime
.
Scheme
,
master
string
)
(
*
ProxyServer
,
error
)
{
func
NewProxyServer
(
o
*
Options
)
(
*
ProxyServer
,
error
)
{
return
newProxyServer
(
o
.
config
,
o
.
CleanupAndExit
,
o
.
scheme
,
o
.
master
)
}
func
newProxyServer
(
config
*
proxyconfigapi
.
KubeProxyConfiguration
,
cleanupAndExit
bool
,
scheme
*
runtime
.
Scheme
,
master
string
)
(
*
ProxyServer
,
error
)
{
if
config
==
nil
{
if
config
==
nil
{
return
nil
,
errors
.
New
(
"config is required"
)
return
nil
,
errors
.
New
(
"config is required"
)
}
}
...
...
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