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
ff8b70c4
Commit
ff8b70c4
authored
May 17, 2018
by
Weibin Lin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Init ipvsInterface only when ipvs modules are present
parent
09c9ecd3
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
6 additions
and
1 deletion
+6
-1
server_others.go
cmd/kube-proxy/app/server_others.go
+3
-1
proxier.go
pkg/proxy/ipvs/proxier.go
+3
-0
No files found.
cmd/kube-proxy/app/server_others.go
View file @
ff8b70c4
...
@@ -92,9 +92,11 @@ func newProxyServer(
...
@@ -92,9 +92,11 @@ func newProxyServer(
dbus
=
utildbus
.
New
()
dbus
=
utildbus
.
New
()
iptInterface
=
utiliptables
.
New
(
execer
,
dbus
,
protocol
)
iptInterface
=
utiliptables
.
New
(
execer
,
dbus
,
protocol
)
ipvsInterface
=
utilipvs
.
New
(
execer
)
kernelHandler
=
ipvs
.
NewLinuxKernelHandler
()
kernelHandler
=
ipvs
.
NewLinuxKernelHandler
()
ipsetInterface
=
utilipset
.
New
(
execer
)
ipsetInterface
=
utilipset
.
New
(
execer
)
if
canUse
,
_
:=
ipvs
.
CanUseIPVSProxier
(
kernelHandler
,
ipsetInterface
);
canUse
{
ipvsInterface
=
utilipvs
.
New
(
execer
)
}
// We omit creation of pretty much everything if we run in cleanup mode
// We omit creation of pretty much everything if we run in cleanup mode
if
cleanupAndExit
{
if
cleanupAndExit
{
...
...
pkg/proxy/ipvs/proxier.go
View file @
ff8b70c4
...
@@ -547,6 +547,9 @@ func cleanupIptablesLeftovers(ipt utiliptables.Interface) (encounteredError bool
...
@@ -547,6 +547,9 @@ func cleanupIptablesLeftovers(ipt utiliptables.Interface) (encounteredError bool
// CleanupLeftovers clean up all ipvs and iptables rules created by ipvs Proxier.
// CleanupLeftovers clean up all ipvs and iptables rules created by ipvs Proxier.
func
CleanupLeftovers
(
ipvs
utilipvs
.
Interface
,
ipt
utiliptables
.
Interface
,
ipset
utilipset
.
Interface
,
cleanupIPVS
bool
)
(
encounteredError
bool
)
{
func
CleanupLeftovers
(
ipvs
utilipvs
.
Interface
,
ipt
utiliptables
.
Interface
,
ipset
utilipset
.
Interface
,
cleanupIPVS
bool
)
(
encounteredError
bool
)
{
if
canUse
,
_
:=
CanUseIPVSProxier
(
NewLinuxKernelHandler
(),
ipset
);
!
canUse
{
return
false
}
if
cleanupIPVS
{
if
cleanupIPVS
{
// Return immediately when ipvs interface is nil - Probably initialization failed in somewhere.
// Return immediately when ipvs interface is nil - Probably initialization failed in somewhere.
if
ipvs
==
nil
{
if
ipvs
==
nil
{
...
...
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