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
f94b7eda
Commit
f94b7eda
authored
Feb 28, 2018
by
Da K. Ma
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added unscheduable node UT for DaemonSet.
Signed-off-by:
Da K. Ma
<
madaxa@cn.ibm.com
>
parent
dac59e4d
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
20 additions
and
0 deletions
+20
-0
daemon_controller_test.go
pkg/controller/daemon/daemon_controller_test.go
+20
-0
No files found.
pkg/controller/daemon/daemon_controller_test.go
View file @
f94b7eda
...
...
@@ -1545,6 +1545,7 @@ func TestNodeShouldRunDaemonPod(t *testing.T) {
predicateName
string
podsOnNode
[]
*
v1
.
Pod
nodeCondition
[]
v1
.
NodeCondition
nodeUnschedulable
bool
ds
*
apps
.
DaemonSet
wantToRun
,
shouldSchedule
,
shouldContinueRunning
bool
err
error
...
...
@@ -1800,6 +1801,24 @@ func TestNodeShouldRunDaemonPod(t *testing.T) {
shouldSchedule
:
true
,
shouldContinueRunning
:
true
,
},
{
predicateName
:
"ShouldRunDaemonPodOnUnscheduableNode"
,
ds
:
&
apps
.
DaemonSet
{
Spec
:
apps
.
DaemonSetSpec
{
Selector
:
&
metav1
.
LabelSelector
{
MatchLabels
:
simpleDaemonSetLabel
},
Template
:
v1
.
PodTemplateSpec
{
ObjectMeta
:
metav1
.
ObjectMeta
{
Labels
:
simpleDaemonSetLabel
,
},
Spec
:
resourcePodSpec
(
""
,
"50M"
,
"0.5"
),
},
},
},
nodeUnschedulable
:
true
,
wantToRun
:
true
,
shouldSchedule
:
true
,
shouldContinueRunning
:
true
,
},
}
for
i
,
c
:=
range
cases
{
...
...
@@ -1807,6 +1826,7 @@ func TestNodeShouldRunDaemonPod(t *testing.T) {
node
:=
newNode
(
"test-node"
,
simpleDaemonSetLabel
)
node
.
Status
.
Conditions
=
append
(
node
.
Status
.
Conditions
,
c
.
nodeCondition
...
)
node
.
Status
.
Allocatable
=
allocatableResources
(
"100M"
,
"1"
)
node
.
Spec
.
Unschedulable
=
c
.
nodeUnschedulable
manager
,
_
,
_
,
err
:=
newTestController
()
if
err
!=
nil
{
t
.
Fatalf
(
"error creating DaemonSets controller: %v"
,
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