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
fb3a6dc4
Commit
fb3a6dc4
authored
Jul 14, 2018
by
tianshapjq
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
remove the unused verifyRemainingObjects function
parent
c861ceb4
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
0 additions
and
52 deletions
+0
-52
replicaset_test.go
test/integration/replicaset/replicaset_test.go
+0
-26
replicationcontroller_test.go
...ation/replicationcontroller/replicationcontroller_test.go
+0
-26
No files found.
test/integration/replicaset/replicaset_test.go
View file @
fb3a6dc4
...
@@ -112,32 +112,6 @@ func newMatchingPod(podName, namespace string) *v1.Pod {
...
@@ -112,32 +112,6 @@ func newMatchingPod(podName, namespace string) *v1.Pod {
}
}
}
}
// verifyRemainingObjects verifies if the number of the remaining replica
// sets and pods are rsNum and podNum. It returns error if the
// communication with the API server fails.
func
verifyRemainingObjects
(
t
*
testing
.
T
,
clientSet
clientset
.
Interface
,
namespace
string
,
rsNum
,
podNum
int
)
(
bool
,
error
)
{
rsClient
:=
clientSet
.
ExtensionsV1beta1
()
.
ReplicaSets
(
namespace
)
podClient
:=
clientSet
.
CoreV1
()
.
Pods
(
namespace
)
pods
,
err
:=
podClient
.
List
(
metav1
.
ListOptions
{})
if
err
!=
nil
{
return
false
,
fmt
.
Errorf
(
"Failed to list pods: %v"
,
err
)
}
var
ret
=
true
if
len
(
pods
.
Items
)
!=
podNum
{
ret
=
false
t
.
Logf
(
"expect %d pods, got %d pods"
,
podNum
,
len
(
pods
.
Items
))
}
rss
,
err
:=
rsClient
.
List
(
metav1
.
ListOptions
{})
if
err
!=
nil
{
return
false
,
fmt
.
Errorf
(
"Failed to list replica sets: %v"
,
err
)
}
if
len
(
rss
.
Items
)
!=
rsNum
{
ret
=
false
t
.
Logf
(
"expect %d RSs, got %d RSs"
,
rsNum
,
len
(
rss
.
Items
))
}
return
ret
,
nil
}
func
rmSetup
(
t
*
testing
.
T
)
(
*
httptest
.
Server
,
framework
.
CloseFunc
,
*
replicaset
.
ReplicaSetController
,
informers
.
SharedInformerFactory
,
clientset
.
Interface
)
{
func
rmSetup
(
t
*
testing
.
T
)
(
*
httptest
.
Server
,
framework
.
CloseFunc
,
*
replicaset
.
ReplicaSetController
,
informers
.
SharedInformerFactory
,
clientset
.
Interface
)
{
masterConfig
:=
framework
.
NewIntegrationTestMasterConfig
()
masterConfig
:=
framework
.
NewIntegrationTestMasterConfig
()
_
,
s
,
closeFn
:=
framework
.
RunAMaster
(
masterConfig
)
_
,
s
,
closeFn
:=
framework
.
RunAMaster
(
masterConfig
)
...
...
test/integration/replicationcontroller/replicationcontroller_test.go
View file @
fb3a6dc4
...
@@ -105,32 +105,6 @@ func newMatchingPod(podName, namespace string) *v1.Pod {
...
@@ -105,32 +105,6 @@ func newMatchingPod(podName, namespace string) *v1.Pod {
}
}
}
}
// verifyRemainingObjects verifies if the number of the remaining replication
// controllers and pods are rcNum and podNum. It returns error if the
// communication with the API server fails.
func
verifyRemainingObjects
(
t
*
testing
.
T
,
clientSet
clientset
.
Interface
,
namespace
string
,
rcNum
,
podNum
int
)
(
bool
,
error
)
{
rcClient
:=
clientSet
.
CoreV1
()
.
ReplicationControllers
(
namespace
)
podClient
:=
clientSet
.
CoreV1
()
.
Pods
(
namespace
)
pods
,
err
:=
podClient
.
List
(
metav1
.
ListOptions
{})
if
err
!=
nil
{
return
false
,
fmt
.
Errorf
(
"Failed to list pods: %v"
,
err
)
}
var
ret
=
true
if
len
(
pods
.
Items
)
!=
podNum
{
ret
=
false
t
.
Logf
(
"expect %d pods, got %d pods"
,
podNum
,
len
(
pods
.
Items
))
}
rcs
,
err
:=
rcClient
.
List
(
metav1
.
ListOptions
{})
if
err
!=
nil
{
return
false
,
fmt
.
Errorf
(
"Failed to list replication controllers: %v"
,
err
)
}
if
len
(
rcs
.
Items
)
!=
rcNum
{
ret
=
false
t
.
Logf
(
"expect %d RCs, got %d RCs"
,
rcNum
,
len
(
rcs
.
Items
))
}
return
ret
,
nil
}
func
rmSetup
(
t
*
testing
.
T
)
(
*
httptest
.
Server
,
framework
.
CloseFunc
,
*
replication
.
ReplicationManager
,
informers
.
SharedInformerFactory
,
clientset
.
Interface
)
{
func
rmSetup
(
t
*
testing
.
T
)
(
*
httptest
.
Server
,
framework
.
CloseFunc
,
*
replication
.
ReplicationManager
,
informers
.
SharedInformerFactory
,
clientset
.
Interface
)
{
masterConfig
:=
framework
.
NewIntegrationTestMasterConfig
()
masterConfig
:=
framework
.
NewIntegrationTestMasterConfig
()
_
,
s
,
closeFn
:=
framework
.
RunAMaster
(
masterConfig
)
_
,
s
,
closeFn
:=
framework
.
RunAMaster
(
masterConfig
)
...
...
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