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
981a064c
Unverified
Commit
981a064c
authored
Oct 08, 2018
by
k8s-ci-robot
Committed by
GitHub
Oct 08, 2018
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #68793 from aveshagarwal/master-rhbz-1628998
Fix DS tests to set node selectors related annotations on test namespaces to empty.
parents
8fa5d386
ea3e6768
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
31 additions
and
1 deletion
+31
-1
daemon_set.go
test/e2e/apps/daemon_set.go
+31
-1
No files found.
test/e2e/apps/daemon_set.go
View file @
981a064c
...
@@ -53,6 +53,10 @@ const (
...
@@ -53,6 +53,10 @@ const (
daemonsetColorLabel
=
daemonsetLabelPrefix
+
"color"
daemonsetColorLabel
=
daemonsetLabelPrefix
+
"color"
)
)
// The annotation key scheduler.alpha.kubernetes.io/node-selector is for assigning
// node selectors labels to namespaces
var
NamespaceNodeSelectors
=
[]
string
{
"scheduler.alpha.kubernetes.io/node-selector"
}
// This test must be run in serial because it assumes the Daemon Set pods will
// This test must be run in serial because it assumes the Daemon Set pods will
// always get scheduled. If we run other tests in parallel, this may not
// always get scheduled. If we run other tests in parallel, this may not
// happen. In the future, running in parallel may work if we have an eviction
// happen. In the future, running in parallel may work if we have an eviction
...
@@ -99,7 +103,13 @@ var _ = SIGDescribe("Daemon set [Serial]", func() {
...
@@ -99,7 +103,13 @@ var _ = SIGDescribe("Daemon set [Serial]", func() {
ns
=
f
.
Namespace
.
Name
ns
=
f
.
Namespace
.
Name
c
=
f
.
ClientSet
c
=
f
.
ClientSet
err
:=
clearDaemonSetNodeLabels
(
c
)
updatedNS
,
err
:=
updateNamespaceAnnotations
(
c
,
ns
)
Expect
(
err
)
.
NotTo
(
HaveOccurred
())
ns
=
updatedNS
.
Name
err
=
clearDaemonSetNodeLabels
(
c
)
Expect
(
err
)
.
NotTo
(
HaveOccurred
())
Expect
(
err
)
.
NotTo
(
HaveOccurred
())
})
})
...
@@ -494,6 +504,26 @@ func clearDaemonSetNodeLabels(c clientset.Interface) error {
...
@@ -494,6 +504,26 @@ func clearDaemonSetNodeLabels(c clientset.Interface) error {
return
nil
return
nil
}
}
// updateNamespaceAnnotations sets node selectors related annotations on tests namespaces to empty
func
updateNamespaceAnnotations
(
c
clientset
.
Interface
,
nsName
string
)
(
*
v1
.
Namespace
,
error
)
{
nsClient
:=
c
.
CoreV1
()
.
Namespaces
()
ns
,
err
:=
nsClient
.
Get
(
nsName
,
metav1
.
GetOptions
{})
if
err
!=
nil
{
return
nil
,
err
}
if
ns
.
Annotations
==
nil
{
ns
.
Annotations
=
make
(
map
[
string
]
string
)
}
for
_
,
n
:=
range
NamespaceNodeSelectors
{
ns
.
Annotations
[
n
]
=
""
}
return
nsClient
.
Update
(
ns
)
}
func
setDaemonSetNodeLabels
(
c
clientset
.
Interface
,
nodeName
string
,
labels
map
[
string
]
string
)
(
*
v1
.
Node
,
error
)
{
func
setDaemonSetNodeLabels
(
c
clientset
.
Interface
,
nodeName
string
,
labels
map
[
string
]
string
)
(
*
v1
.
Node
,
error
)
{
nodeClient
:=
c
.
CoreV1
()
.
Nodes
()
nodeClient
:=
c
.
CoreV1
()
.
Nodes
()
var
newNode
*
v1
.
Node
var
newNode
*
v1
.
Node
...
...
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