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
9ad9e7ef
Commit
9ad9e7ef
authored
Jul 12, 2018
by
Wayne Song
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Don't validate HealthzBindAddress in KubeProxyConfiguration if it's empty
parent
d2696d56
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
23 additions
and
1 deletion
+23
-1
validation.go
pkg/proxy/apis/kubeproxyconfig/validation/validation.go
+3
-1
validation_test.go
pkg/proxy/apis/kubeproxyconfig/validation/validation_test.go
+20
-0
No files found.
pkg/proxy/apis/kubeproxyconfig/validation/validation.go
View file @
9ad9e7ef
...
...
@@ -60,7 +60,9 @@ func Validate(config *kubeproxyconfig.KubeProxyConfiguration) field.ErrorList {
allErrs
=
append
(
allErrs
,
field
.
Invalid
(
newPath
.
Child
(
"BindAddress"
),
config
.
BindAddress
,
"not a valid textual representation of an IP address"
))
}
allErrs
=
append
(
allErrs
,
validateHostPort
(
config
.
HealthzBindAddress
,
newPath
.
Child
(
"HealthzBindAddress"
))
...
)
if
config
.
HealthzBindAddress
!=
""
{
allErrs
=
append
(
allErrs
,
validateHostPort
(
config
.
HealthzBindAddress
,
newPath
.
Child
(
"HealthzBindAddress"
))
...
)
}
allErrs
=
append
(
allErrs
,
validateHostPort
(
config
.
MetricsBindAddress
,
newPath
.
Child
(
"MetricsBindAddress"
))
...
)
if
config
.
ClusterCIDR
!=
""
{
...
...
pkg/proxy/apis/kubeproxyconfig/validation/validation_test.go
View file @
9ad9e7ef
...
...
@@ -82,6 +82,26 @@ func TestValidateKubeProxyConfiguration(t *testing.T) {
TCPCloseWaitTimeout
:
&
metav1
.
Duration
{
Duration
:
5
*
time
.
Second
},
},
},
{
BindAddress
:
"192.168.59.103"
,
HealthzBindAddress
:
""
,
MetricsBindAddress
:
"127.0.0.1:10249"
,
ClusterCIDR
:
"192.168.59.0/24"
,
UDPIdleTimeout
:
metav1
.
Duration
{
Duration
:
1
*
time
.
Second
},
ConfigSyncPeriod
:
metav1
.
Duration
{
Duration
:
1
*
time
.
Second
},
IPTables
:
kubeproxyconfig
.
KubeProxyIPTablesConfiguration
{
MasqueradeAll
:
true
,
SyncPeriod
:
metav1
.
Duration
{
Duration
:
5
*
time
.
Second
},
MinSyncPeriod
:
metav1
.
Duration
{
Duration
:
2
*
time
.
Second
},
},
Conntrack
:
kubeproxyconfig
.
KubeProxyConntrackConfiguration
{
Max
:
pointer
.
Int32Ptr
(
2
),
MaxPerCore
:
pointer
.
Int32Ptr
(
1
),
Min
:
pointer
.
Int32Ptr
(
1
),
TCPEstablishedTimeout
:
&
metav1
.
Duration
{
Duration
:
5
*
time
.
Second
},
TCPCloseWaitTimeout
:
&
metav1
.
Duration
{
Duration
:
5
*
time
.
Second
},
},
},
}
for
_
,
successCase
:=
range
successCases
{
...
...
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