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
617e6f4f
Commit
617e6f4f
authored
Aug 29, 2017
by
m1093782566
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
remove explictly set timeout value
parent
1faa6f56
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
17 additions
and
109 deletions
+17
-109
controller.go
pkg/master/controller.go
+0
-6
controller_test.go
pkg/master/controller_test.go
+17
-103
No files found.
pkg/master/controller.go
View file @
617e6f4f
...
@@ -250,7 +250,6 @@ func (c *Controller) CreateOrUpdateMasterServiceIfNeeded(serviceName string, ser
...
@@ -250,7 +250,6 @@ func (c *Controller) CreateOrUpdateMasterServiceIfNeeded(serviceName string, ser
}
}
return
nil
return
nil
}
}
timeoutSeconds
:=
api
.
DefaultClientIPServiceAffinitySeconds
svc
:=
&
api
.
Service
{
svc
:=
&
api
.
Service
{
ObjectMeta
:
metav1
.
ObjectMeta
{
ObjectMeta
:
metav1
.
ObjectMeta
{
Name
:
serviceName
,
Name
:
serviceName
,
...
@@ -264,11 +263,6 @@ func (c *Controller) CreateOrUpdateMasterServiceIfNeeded(serviceName string, ser
...
@@ -264,11 +263,6 @@ func (c *Controller) CreateOrUpdateMasterServiceIfNeeded(serviceName string, ser
ClusterIP
:
serviceIP
.
String
(),
ClusterIP
:
serviceIP
.
String
(),
SessionAffinity
:
api
.
ServiceAffinityClientIP
,
SessionAffinity
:
api
.
ServiceAffinityClientIP
,
Type
:
serviceType
,
Type
:
serviceType
,
SessionAffinityConfig
:
&
api
.
SessionAffinityConfig
{
ClientIP
:
&
api
.
ClientIPConfig
{
TimeoutSeconds
:
&
timeoutSeconds
,
},
},
},
},
}
}
...
...
pkg/master/controller_test.go
View file @
617e6f4f
...
@@ -546,7 +546,6 @@ func TestCreateOrUpdateMasterService(t *testing.T) {
...
@@ -546,7 +546,6 @@ func TestCreateOrUpdateMasterService(t *testing.T) {
om
:=
func
(
name
string
)
metav1
.
ObjectMeta
{
om
:=
func
(
name
string
)
metav1
.
ObjectMeta
{
return
metav1
.
ObjectMeta
{
Namespace
:
ns
,
Name
:
name
}
return
metav1
.
ObjectMeta
{
Namespace
:
ns
,
Name
:
name
}
}
}
timeoutSeconds
:=
api
.
DefaultClientIPServiceAffinitySeconds
create_tests
:=
[]
struct
{
create_tests
:=
[]
struct
{
testName
string
testName
string
...
@@ -571,12 +570,7 @@ func TestCreateOrUpdateMasterService(t *testing.T) {
...
@@ -571,12 +570,7 @@ func TestCreateOrUpdateMasterService(t *testing.T) {
Selector
:
nil
,
Selector
:
nil
,
ClusterIP
:
"1.2.3.4"
,
ClusterIP
:
"1.2.3.4"
,
SessionAffinity
:
api
.
ServiceAffinityClientIP
,
SessionAffinity
:
api
.
ServiceAffinityClientIP
,
SessionAffinityConfig
:
&
api
.
SessionAffinityConfig
{
Type
:
api
.
ServiceTypeClusterIP
,
ClientIP
:
&
api
.
ClientIPConfig
{
TimeoutSeconds
:
&
timeoutSeconds
,
},
},
Type
:
api
.
ServiceTypeClusterIP
,
},
},
},
},
},
},
...
@@ -631,12 +625,7 @@ func TestCreateOrUpdateMasterService(t *testing.T) {
...
@@ -631,12 +625,7 @@ func TestCreateOrUpdateMasterService(t *testing.T) {
Selector
:
nil
,
Selector
:
nil
,
ClusterIP
:
"1.2.3.4"
,
ClusterIP
:
"1.2.3.4"
,
SessionAffinity
:
api
.
ServiceAffinityClientIP
,
SessionAffinity
:
api
.
ServiceAffinityClientIP
,
SessionAffinityConfig
:
&
api
.
SessionAffinityConfig
{
Type
:
api
.
ServiceTypeClusterIP
,
ClientIP
:
&
api
.
ClientIPConfig
{
TimeoutSeconds
:
&
timeoutSeconds
,
},
},
Type
:
api
.
ServiceTypeClusterIP
,
},
},
},
},
expectUpdate
:
&
api
.
Service
{
expectUpdate
:
&
api
.
Service
{
...
@@ -648,12 +637,7 @@ func TestCreateOrUpdateMasterService(t *testing.T) {
...
@@ -648,12 +637,7 @@ func TestCreateOrUpdateMasterService(t *testing.T) {
Selector
:
nil
,
Selector
:
nil
,
ClusterIP
:
"1.2.3.4"
,
ClusterIP
:
"1.2.3.4"
,
SessionAffinity
:
api
.
ServiceAffinityClientIP
,
SessionAffinity
:
api
.
ServiceAffinityClientIP
,
SessionAffinityConfig
:
&
api
.
SessionAffinityConfig
{
Type
:
api
.
ServiceTypeClusterIP
,
ClientIP
:
&
api
.
ClientIPConfig
{
TimeoutSeconds
:
&
timeoutSeconds
,
},
},
Type
:
api
.
ServiceTypeClusterIP
,
},
},
},
},
},
},
...
@@ -674,12 +658,7 @@ func TestCreateOrUpdateMasterService(t *testing.T) {
...
@@ -674,12 +658,7 @@ func TestCreateOrUpdateMasterService(t *testing.T) {
Selector
:
nil
,
Selector
:
nil
,
ClusterIP
:
"1.2.3.4"
,
ClusterIP
:
"1.2.3.4"
,
SessionAffinity
:
api
.
ServiceAffinityClientIP
,
SessionAffinity
:
api
.
ServiceAffinityClientIP
,
SessionAffinityConfig
:
&
api
.
SessionAffinityConfig
{
Type
:
api
.
ServiceTypeClusterIP
,
ClientIP
:
&
api
.
ClientIPConfig
{
TimeoutSeconds
:
&
timeoutSeconds
,
},
},
Type
:
api
.
ServiceTypeClusterIP
,
},
},
},
},
expectUpdate
:
&
api
.
Service
{
expectUpdate
:
&
api
.
Service
{
...
@@ -692,12 +671,7 @@ func TestCreateOrUpdateMasterService(t *testing.T) {
...
@@ -692,12 +671,7 @@ func TestCreateOrUpdateMasterService(t *testing.T) {
Selector
:
nil
,
Selector
:
nil
,
ClusterIP
:
"1.2.3.4"
,
ClusterIP
:
"1.2.3.4"
,
SessionAffinity
:
api
.
ServiceAffinityClientIP
,
SessionAffinity
:
api
.
ServiceAffinityClientIP
,
SessionAffinityConfig
:
&
api
.
SessionAffinityConfig
{
Type
:
api
.
ServiceTypeClusterIP
,
ClientIP
:
&
api
.
ClientIPConfig
{
TimeoutSeconds
:
&
timeoutSeconds
,
},
},
Type
:
api
.
ServiceTypeClusterIP
,
},
},
},
},
},
},
...
@@ -717,12 +691,7 @@ func TestCreateOrUpdateMasterService(t *testing.T) {
...
@@ -717,12 +691,7 @@ func TestCreateOrUpdateMasterService(t *testing.T) {
Selector
:
nil
,
Selector
:
nil
,
ClusterIP
:
"1.2.3.4"
,
ClusterIP
:
"1.2.3.4"
,
SessionAffinity
:
api
.
ServiceAffinityClientIP
,
SessionAffinity
:
api
.
ServiceAffinityClientIP
,
SessionAffinityConfig
:
&
api
.
SessionAffinityConfig
{
Type
:
api
.
ServiceTypeClusterIP
,
ClientIP
:
&
api
.
ClientIPConfig
{
TimeoutSeconds
:
&
timeoutSeconds
,
},
},
Type
:
api
.
ServiceTypeClusterIP
,
},
},
},
},
expectUpdate
:
&
api
.
Service
{
expectUpdate
:
&
api
.
Service
{
...
@@ -734,12 +703,7 @@ func TestCreateOrUpdateMasterService(t *testing.T) {
...
@@ -734,12 +703,7 @@ func TestCreateOrUpdateMasterService(t *testing.T) {
Selector
:
nil
,
Selector
:
nil
,
ClusterIP
:
"1.2.3.4"
,
ClusterIP
:
"1.2.3.4"
,
SessionAffinity
:
api
.
ServiceAffinityClientIP
,
SessionAffinity
:
api
.
ServiceAffinityClientIP
,
SessionAffinityConfig
:
&
api
.
SessionAffinityConfig
{
Type
:
api
.
ServiceTypeClusterIP
,
ClientIP
:
&
api
.
ClientIPConfig
{
TimeoutSeconds
:
&
timeoutSeconds
,
},
},
Type
:
api
.
ServiceTypeClusterIP
,
},
},
},
},
},
},
...
@@ -759,12 +723,7 @@ func TestCreateOrUpdateMasterService(t *testing.T) {
...
@@ -759,12 +723,7 @@ func TestCreateOrUpdateMasterService(t *testing.T) {
Selector
:
nil
,
Selector
:
nil
,
ClusterIP
:
"1.2.3.4"
,
ClusterIP
:
"1.2.3.4"
,
SessionAffinity
:
api
.
ServiceAffinityClientIP
,
SessionAffinity
:
api
.
ServiceAffinityClientIP
,
SessionAffinityConfig
:
&
api
.
SessionAffinityConfig
{
Type
:
api
.
ServiceTypeClusterIP
,
ClientIP
:
&
api
.
ClientIPConfig
{
TimeoutSeconds
:
&
timeoutSeconds
,
},
},
Type
:
api
.
ServiceTypeClusterIP
,
},
},
},
},
expectUpdate
:
&
api
.
Service
{
expectUpdate
:
&
api
.
Service
{
...
@@ -776,12 +735,7 @@ func TestCreateOrUpdateMasterService(t *testing.T) {
...
@@ -776,12 +735,7 @@ func TestCreateOrUpdateMasterService(t *testing.T) {
Selector
:
nil
,
Selector
:
nil
,
ClusterIP
:
"1.2.3.4"
,
ClusterIP
:
"1.2.3.4"
,
SessionAffinity
:
api
.
ServiceAffinityClientIP
,
SessionAffinity
:
api
.
ServiceAffinityClientIP
,
SessionAffinityConfig
:
&
api
.
SessionAffinityConfig
{
Type
:
api
.
ServiceTypeClusterIP
,
ClientIP
:
&
api
.
ClientIPConfig
{
TimeoutSeconds
:
&
timeoutSeconds
,
},
},
Type
:
api
.
ServiceTypeClusterIP
,
},
},
},
},
},
},
...
@@ -801,12 +755,7 @@ func TestCreateOrUpdateMasterService(t *testing.T) {
...
@@ -801,12 +755,7 @@ func TestCreateOrUpdateMasterService(t *testing.T) {
Selector
:
nil
,
Selector
:
nil
,
ClusterIP
:
"1.2.3.4"
,
ClusterIP
:
"1.2.3.4"
,
SessionAffinity
:
api
.
ServiceAffinityClientIP
,
SessionAffinity
:
api
.
ServiceAffinityClientIP
,
SessionAffinityConfig
:
&
api
.
SessionAffinityConfig
{
Type
:
api
.
ServiceTypeClusterIP
,
ClientIP
:
&
api
.
ClientIPConfig
{
TimeoutSeconds
:
&
timeoutSeconds
,
},
},
Type
:
api
.
ServiceTypeClusterIP
,
},
},
},
},
expectUpdate
:
&
api
.
Service
{
expectUpdate
:
&
api
.
Service
{
...
@@ -818,12 +767,7 @@ func TestCreateOrUpdateMasterService(t *testing.T) {
...
@@ -818,12 +767,7 @@ func TestCreateOrUpdateMasterService(t *testing.T) {
Selector
:
nil
,
Selector
:
nil
,
ClusterIP
:
"1.2.3.4"
,
ClusterIP
:
"1.2.3.4"
,
SessionAffinity
:
api
.
ServiceAffinityClientIP
,
SessionAffinity
:
api
.
ServiceAffinityClientIP
,
SessionAffinityConfig
:
&
api
.
SessionAffinityConfig
{
Type
:
api
.
ServiceTypeClusterIP
,
ClientIP
:
&
api
.
ClientIPConfig
{
TimeoutSeconds
:
&
timeoutSeconds
,
},
},
Type
:
api
.
ServiceTypeClusterIP
,
},
},
},
},
},
},
...
@@ -843,12 +787,7 @@ func TestCreateOrUpdateMasterService(t *testing.T) {
...
@@ -843,12 +787,7 @@ func TestCreateOrUpdateMasterService(t *testing.T) {
Selector
:
nil
,
Selector
:
nil
,
ClusterIP
:
"1.2.3.4"
,
ClusterIP
:
"1.2.3.4"
,
SessionAffinity
:
api
.
ServiceAffinityClientIP
,
SessionAffinity
:
api
.
ServiceAffinityClientIP
,
SessionAffinityConfig
:
&
api
.
SessionAffinityConfig
{
Type
:
api
.
ServiceTypeClusterIP
,
ClientIP
:
&
api
.
ClientIPConfig
{
TimeoutSeconds
:
&
timeoutSeconds
,
},
},
Type
:
api
.
ServiceTypeClusterIP
,
},
},
},
},
expectUpdate
:
&
api
.
Service
{
expectUpdate
:
&
api
.
Service
{
...
@@ -860,12 +799,7 @@ func TestCreateOrUpdateMasterService(t *testing.T) {
...
@@ -860,12 +799,7 @@ func TestCreateOrUpdateMasterService(t *testing.T) {
Selector
:
nil
,
Selector
:
nil
,
ClusterIP
:
"1.2.3.4"
,
ClusterIP
:
"1.2.3.4"
,
SessionAffinity
:
api
.
ServiceAffinityClientIP
,
SessionAffinity
:
api
.
ServiceAffinityClientIP
,
SessionAffinityConfig
:
&
api
.
SessionAffinityConfig
{
Type
:
api
.
ServiceTypeClusterIP
,
ClientIP
:
&
api
.
ClientIPConfig
{
TimeoutSeconds
:
&
timeoutSeconds
,
},
},
Type
:
api
.
ServiceTypeClusterIP
,
},
},
},
},
},
},
...
@@ -885,12 +819,7 @@ func TestCreateOrUpdateMasterService(t *testing.T) {
...
@@ -885,12 +819,7 @@ func TestCreateOrUpdateMasterService(t *testing.T) {
Selector
:
nil
,
Selector
:
nil
,
ClusterIP
:
"1.2.3.4"
,
ClusterIP
:
"1.2.3.4"
,
SessionAffinity
:
api
.
ServiceAffinityClientIP
,
SessionAffinity
:
api
.
ServiceAffinityClientIP
,
SessionAffinityConfig
:
&
api
.
SessionAffinityConfig
{
Type
:
api
.
ServiceTypeNodePort
,
ClientIP
:
&
api
.
ClientIPConfig
{
TimeoutSeconds
:
&
timeoutSeconds
,
},
},
Type
:
api
.
ServiceTypeNodePort
,
},
},
},
},
expectUpdate
:
&
api
.
Service
{
expectUpdate
:
&
api
.
Service
{
...
@@ -902,12 +831,7 @@ func TestCreateOrUpdateMasterService(t *testing.T) {
...
@@ -902,12 +831,7 @@ func TestCreateOrUpdateMasterService(t *testing.T) {
Selector
:
nil
,
Selector
:
nil
,
ClusterIP
:
"1.2.3.4"
,
ClusterIP
:
"1.2.3.4"
,
SessionAffinity
:
api
.
ServiceAffinityClientIP
,
SessionAffinity
:
api
.
ServiceAffinityClientIP
,
SessionAffinityConfig
:
&
api
.
SessionAffinityConfig
{
Type
:
api
.
ServiceTypeClusterIP
,
ClientIP
:
&
api
.
ClientIPConfig
{
TimeoutSeconds
:
&
timeoutSeconds
,
},
},
Type
:
api
.
ServiceTypeClusterIP
,
},
},
},
},
},
},
...
@@ -927,12 +851,7 @@ func TestCreateOrUpdateMasterService(t *testing.T) {
...
@@ -927,12 +851,7 @@ func TestCreateOrUpdateMasterService(t *testing.T) {
Selector
:
nil
,
Selector
:
nil
,
ClusterIP
:
"1.2.3.4"
,
ClusterIP
:
"1.2.3.4"
,
SessionAffinity
:
api
.
ServiceAffinityClientIP
,
SessionAffinity
:
api
.
ServiceAffinityClientIP
,
SessionAffinityConfig
:
&
api
.
SessionAffinityConfig
{
Type
:
api
.
ServiceTypeClusterIP
,
ClientIP
:
&
api
.
ClientIPConfig
{
TimeoutSeconds
:
&
timeoutSeconds
,
},
},
Type
:
api
.
ServiceTypeClusterIP
,
},
},
},
},
expectUpdate
:
nil
,
expectUpdate
:
nil
,
...
@@ -991,12 +910,7 @@ func TestCreateOrUpdateMasterService(t *testing.T) {
...
@@ -991,12 +910,7 @@ func TestCreateOrUpdateMasterService(t *testing.T) {
Selector
:
nil
,
Selector
:
nil
,
ClusterIP
:
"1.2.3.4"
,
ClusterIP
:
"1.2.3.4"
,
SessionAffinity
:
api
.
ServiceAffinityClientIP
,
SessionAffinity
:
api
.
ServiceAffinityClientIP
,
SessionAffinityConfig
:
&
api
.
SessionAffinityConfig
{
Type
:
api
.
ServiceTypeClusterIP
,
ClientIP
:
&
api
.
ClientIPConfig
{
TimeoutSeconds
:
&
timeoutSeconds
,
},
},
Type
:
api
.
ServiceTypeClusterIP
,
},
},
},
},
expectUpdate
:
nil
,
expectUpdate
:
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