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
3d9a52d8
Commit
3d9a52d8
authored
Sep 11, 2015
by
Mike Danese
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add e2e test for changing the labels of a node
parent
1065872d
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
13 additions
and
4 deletions
+13
-4
daemon_set.go
test/e2e/daemon_set.go
+13
-4
No files found.
test/e2e/daemon_set.go
View file @
3d9a52d8
...
@@ -125,7 +125,7 @@ func testDaemonSets(f *Framework) {
...
@@ -125,7 +125,7 @@ func testDaemonSets(f *Framework) {
retryTimeout
:=
1
*
time
.
Minute
retryTimeout
:=
1
*
time
.
Minute
retryInterval
:=
5
*
time
.
Second
retryInterval
:=
5
*
time
.
Second
By
(
fmt
.
Sprintf
(
"Creating simple daemon set %s"
,
simpleDSName
)
)
Logf
(
"Creating simple daemon set %s"
,
simpleDSName
)
_
,
err
:=
c
.
DaemonSets
(
ns
)
.
Create
(
&
experimental
.
DaemonSet
{
_
,
err
:=
c
.
DaemonSets
(
ns
)
.
Create
(
&
experimental
.
DaemonSet
{
ObjectMeta
:
api
.
ObjectMeta
{
ObjectMeta
:
api
.
ObjectMeta
{
Name
:
simpleDSName
,
Name
:
simpleDSName
,
...
@@ -169,7 +169,7 @@ func testDaemonSets(f *Framework) {
...
@@ -169,7 +169,7 @@ func testDaemonSets(f *Framework) {
complexDSName
:=
"complex-daemon-set"
complexDSName
:=
"complex-daemon-set"
complexLabel
:=
map
[
string
]
string
{
"name"
:
complexDSName
}
complexLabel
:=
map
[
string
]
string
{
"name"
:
complexDSName
}
nodeSelector
:=
map
[
string
]
string
{
"color"
:
"blue"
}
nodeSelector
:=
map
[
string
]
string
{
"color"
:
"blue"
}
By
(
fmt
.
Sprintf
(
"Creating daemon with a node selector %s"
,
complexDSName
)
)
Logf
(
"Creating daemon with a node selector %s"
,
complexDSName
)
_
,
err
=
c
.
DaemonSets
(
ns
)
.
Create
(
&
experimental
.
DaemonSet
{
_
,
err
=
c
.
DaemonSets
(
ns
)
.
Create
(
&
experimental
.
DaemonSet
{
ObjectMeta
:
api
.
ObjectMeta
{
ObjectMeta
:
api
.
ObjectMeta
{
Name
:
complexDSName
,
Name
:
complexDSName
,
...
@@ -195,11 +195,11 @@ func testDaemonSets(f *Framework) {
...
@@ -195,11 +195,11 @@ func testDaemonSets(f *Framework) {
})
})
Expect
(
err
)
.
NotTo
(
HaveOccurred
())
Expect
(
err
)
.
NotTo
(
HaveOccurred
())
By
(
fmt
.
Sprintf
(
"Initially, daemon pods should not be running on any nodes."
)
)
By
(
"Initially, daemon pods should not be running on any nodes."
)
err
=
wait
.
Poll
(
retryInterval
,
retryTimeout
,
checkRunningOnNoNodes
(
f
,
complexLabel
))
err
=
wait
.
Poll
(
retryInterval
,
retryTimeout
,
checkRunningOnNoNodes
(
f
,
complexLabel
))
Expect
(
err
)
.
NotTo
(
HaveOccurred
(),
"error waiting for daemon pods to be running on no nodes"
)
Expect
(
err
)
.
NotTo
(
HaveOccurred
(),
"error waiting for daemon pods to be running on no nodes"
)
By
(
fmt
.
Sprintf
(
"Change label of node, check that daemon pod is launched."
)
)
By
(
"Change label of node, check that daemon pod is launched."
)
nodeClient
:=
c
.
Nodes
()
nodeClient
:=
c
.
Nodes
()
nodeList
,
err
:=
nodeClient
.
List
(
labels
.
Everything
(),
fields
.
Everything
())
nodeList
,
err
:=
nodeClient
.
List
(
labels
.
Everything
(),
fields
.
Everything
())
Expect
(
len
(
nodeList
.
Items
))
.
To
(
BeNumerically
(
">"
,
0
))
Expect
(
len
(
nodeList
.
Items
))
.
To
(
BeNumerically
(
">"
,
0
))
...
@@ -209,4 +209,13 @@ func testDaemonSets(f *Framework) {
...
@@ -209,4 +209,13 @@ func testDaemonSets(f *Framework) {
Expect
(
len
(
newNode
.
Labels
))
.
To
(
Equal
(
1
))
Expect
(
len
(
newNode
.
Labels
))
.
To
(
Equal
(
1
))
err
=
wait
.
Poll
(
retryInterval
,
retryTimeout
,
checkDaemonPodOnNodes
(
f
,
complexLabel
,
[]
string
{
newNode
.
Name
}))
err
=
wait
.
Poll
(
retryInterval
,
retryTimeout
,
checkDaemonPodOnNodes
(
f
,
complexLabel
,
[]
string
{
newNode
.
Name
}))
Expect
(
err
)
.
NotTo
(
HaveOccurred
(),
"error waiting for daemon pods to be running on new nodes"
)
Expect
(
err
)
.
NotTo
(
HaveOccurred
(),
"error waiting for daemon pods to be running on new nodes"
)
By
(
"remove the node selector and wait for"
)
newNode
,
err
=
nodeClient
.
Get
(
newNode
.
Name
)
Expect
(
err
)
.
NotTo
(
HaveOccurred
(),
"error getting node"
)
newNode
.
Labels
=
map
[
string
]
string
{}
newNode
,
err
=
nodeClient
.
Update
(
newNode
)
Expect
(
err
)
.
NotTo
(
HaveOccurred
())
Expect
(
wait
.
Poll
(
retryInterval
,
retryTimeout
,
checkRunningOnNoNodes
(
f
,
complexLabel
)))
.
NotTo
(
HaveOccurred
(),
"error waiting for daemon pod to not be running on nodes"
)
}
}
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