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
70ce8629
Commit
70ce8629
authored
Aug 10, 2015
by
Jian Huang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix the issue which TestServiceRegistryIPUpdate will randomly run failed.
parent
2bfa9a1f
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
1 deletion
+11
-1
rest_test.go
pkg/registry/service/rest_test.go
+11
-1
No files found.
pkg/registry/service/rest_test.go
View file @
70ce8629
...
@@ -569,6 +569,7 @@ func TestServiceRegistryIPAllocation(t *testing.T) {
...
@@ -569,6 +569,7 @@ func TestServiceRegistryIPAllocation(t *testing.T) {
for
_
,
ip
:=
range
testIPs
{
for
_
,
ip
:=
range
testIPs
{
if
!
rest
.
serviceIPs
.
(
*
ipallocator
.
Range
)
.
Has
(
net
.
ParseIP
(
ip
))
{
if
!
rest
.
serviceIPs
.
(
*
ipallocator
.
Range
)
.
Has
(
net
.
ParseIP
(
ip
))
{
testIP
=
ip
testIP
=
ip
break
}
}
}
}
...
@@ -687,9 +688,18 @@ func TestServiceRegistryIPUpdate(t *testing.T) {
...
@@ -687,9 +688,18 @@ func TestServiceRegistryIPUpdate(t *testing.T) {
t
.
Errorf
(
"Expected port 6503, but got %v"
,
updated_service
.
Spec
.
Ports
[
0
]
.
Port
)
t
.
Errorf
(
"Expected port 6503, but got %v"
,
updated_service
.
Spec
.
Ports
[
0
]
.
Port
)
}
}
testIPs
:=
[]
string
{
"1.2.3.93"
,
"1.2.3.94"
,
"1.2.3.95"
,
"1.2.3.96"
}
testIP
:=
""
for
_
,
ip
:=
range
testIPs
{
if
!
rest
.
serviceIPs
.
(
*
ipallocator
.
Range
)
.
Has
(
net
.
ParseIP
(
ip
))
{
testIP
=
ip
break
}
}
update
=
deepCloneService
(
created_service
)
update
=
deepCloneService
(
created_service
)
update
.
Spec
.
Ports
[
0
]
.
Port
=
6503
update
.
Spec
.
Ports
[
0
]
.
Port
=
6503
update
.
Spec
.
ClusterIP
=
"1.2.3.76"
// error
update
.
Spec
.
ClusterIP
=
testIP
// Error: Cluster IP is immutable
_
,
_
,
err
:=
rest
.
Update
(
ctx
,
update
)
_
,
_
,
err
:=
rest
.
Update
(
ctx
,
update
)
if
err
==
nil
||
!
errors
.
IsInvalid
(
err
)
{
if
err
==
nil
||
!
errors
.
IsInvalid
(
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