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
7e9c685b
Commit
7e9c685b
authored
Aug 15, 2015
by
Tim Hockin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Require same min iptables version as -C
parent
3d309700
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
11 deletions
+12
-11
proxier.go
pkg/proxy/iptables/proxier.go
+12
-11
No files found.
pkg/proxy/iptables/proxier.go
View file @
7e9c685b
...
@@ -16,9 +16,9 @@ limitations under the License.
...
@@ -16,9 +16,9 @@ limitations under the License.
package
iptables
package
iptables
/
*
/
/
NOTE: this needs to be tested in e2e since it uses iptables for everything.
//
NOTE: this needs to be tested in e2e since it uses iptables for everything.
*
/
/
/
import
(
import
(
"bytes"
"bytes"
...
@@ -45,13 +45,14 @@ import (
...
@@ -45,13 +45,14 @@ import (
"k8s.io/kubernetes/pkg/util/slice"
"k8s.io/kubernetes/pkg/util/slice"
)
)
// NOTE: IPTABLES_MIN_VERSION is the minimum version of iptables for which we will use the Proxier
// iptablesMinVersion is the minimum version of iptables for which we will use the Proxier
// from this package instead of the userspace Proxier.
// from this package instead of the userspace Proxier. While most of the
// This is will not be enough, as the version number is somewhat unreliable,
// features we need were available earlier, the '-C' flag was added more
// features are backported in various distros and this could get pretty hairy.
// recently. We use that indirectly in Ensure* functions, and if we don't
// However iptables-1.4.0 was released 2007-Dec-22 and appears to have every feature we use,
// have it, we have to be extra careful about the exact args we feed in being
// so this seems prefectly reasonable for now.
// the same as the args we read back (iptables itself normalizes some args).
const
IPTABLES_MIN_VERSION
string
=
"1.4.0"
// This is the "new" Proxier, so we require "new" versions of tools.
const
iptablesMinVersion
=
utiliptables
.
MinCheckVersion
// the services chain
// the services chain
const
iptablesServicesChain
utiliptables
.
Chain
=
"KUBE-SERVICES"
const
iptablesServicesChain
utiliptables
.
Chain
=
"KUBE-SERVICES"
...
@@ -69,7 +70,7 @@ const iptablesMasqueradeMark = "0x4d415351"
...
@@ -69,7 +70,7 @@ const iptablesMasqueradeMark = "0x4d415351"
// case it will also return false.
// case it will also return false.
func
ShouldUseIptablesProxier
()
(
bool
,
error
)
{
func
ShouldUseIptablesProxier
()
(
bool
,
error
)
{
exec
:=
utilexec
.
New
()
exec
:=
utilexec
.
New
()
minVersion
,
err
:=
semver
.
NewVersion
(
IPTABLES_MIN_VERSION
)
minVersion
,
err
:=
semver
.
NewVersion
(
iptablesMinVersion
)
if
err
!=
nil
{
if
err
!=
nil
{
return
false
,
err
return
false
,
err
}
}
...
...
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