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
ee3fbf9c
Commit
ee3fbf9c
authored
Oct 19, 2017
by
Lion-Wei
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add ProxyModeIPVS in proxy mode validation
parent
65d9b4ef
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
4 additions
and
1 deletion
+4
-1
validation.go
cmd/kube-proxy/app/validation.go
+2
-1
validation_test.go
cmd/kube-proxy/app/validation_test.go
+1
-0
types.go
pkg/apis/componentconfig/types.go
+1
-0
No files found.
cmd/kube-proxy/app/validation.go
View file @
ee3fbf9c
...
@@ -120,9 +120,10 @@ func validateProxyMode(mode componentconfig.ProxyMode, fldPath *field.Path) fiel
...
@@ -120,9 +120,10 @@ func validateProxyMode(mode componentconfig.ProxyMode, fldPath *field.Path) fiel
switch
mode
{
switch
mode
{
case
componentconfig
.
ProxyModeUserspace
:
case
componentconfig
.
ProxyModeUserspace
:
case
componentconfig
.
ProxyModeIPTables
:
case
componentconfig
.
ProxyModeIPTables
:
case
componentconfig
.
ProxyModeIPVS
:
case
""
:
case
""
:
default
:
default
:
modes
:=
[]
string
{
string
(
componentconfig
.
ProxyModeUserspace
),
string
(
componentconfig
.
ProxyModeIPTables
)}
modes
:=
[]
string
{
string
(
componentconfig
.
ProxyModeUserspace
),
string
(
componentconfig
.
ProxyModeIPTables
)
,
string
(
componentconfig
.
ProxyModeIPVS
)
}
errMsg
:=
fmt
.
Sprintf
(
"must be %s or blank (blank means the best-available proxy (currently iptables)"
,
strings
.
Join
(
modes
,
","
))
errMsg
:=
fmt
.
Sprintf
(
"must be %s or blank (blank means the best-available proxy (currently iptables)"
,
strings
.
Join
(
modes
,
","
))
allErrs
=
append
(
allErrs
,
field
.
Invalid
(
fldPath
.
Child
(
"ProxyMode"
),
string
(
mode
),
errMsg
))
allErrs
=
append
(
allErrs
,
field
.
Invalid
(
fldPath
.
Child
(
"ProxyMode"
),
string
(
mode
),
errMsg
))
}
}
...
...
cmd/kube-proxy/app/validation_test.go
View file @
ee3fbf9c
...
@@ -374,6 +374,7 @@ func TestValidateProxyMode(t *testing.T) {
...
@@ -374,6 +374,7 @@ func TestValidateProxyMode(t *testing.T) {
successCases
:=
[]
componentconfig
.
ProxyMode
{
successCases
:=
[]
componentconfig
.
ProxyMode
{
componentconfig
.
ProxyModeUserspace
,
componentconfig
.
ProxyModeUserspace
,
componentconfig
.
ProxyModeIPTables
,
componentconfig
.
ProxyModeIPTables
,
componentconfig
.
ProxyModeIPVS
,
componentconfig
.
ProxyMode
(
""
),
componentconfig
.
ProxyMode
(
""
),
}
}
...
...
pkg/apis/componentconfig/types.go
View file @
ee3fbf9c
...
@@ -158,6 +158,7 @@ type ProxyMode string
...
@@ -158,6 +158,7 @@ type ProxyMode string
const
(
const
(
ProxyModeUserspace
ProxyMode
=
"userspace"
ProxyModeUserspace
ProxyMode
=
"userspace"
ProxyModeIPTables
ProxyMode
=
"iptables"
ProxyModeIPTables
ProxyMode
=
"iptables"
ProxyModeIPVS
ProxyMode
=
"ipvs"
)
)
// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
...
...
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