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
f4d33396
Commit
f4d33396
authored
Feb 26, 2017
by
Kevin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
make kubectl respect taint effect NoExecute
parent
2a29da1f
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
23 additions
and
1 deletion
+23
-1
taints.go
pkg/util/taints/taints.go
+1
-1
taints_test.go
pkg/util/taints/taints_test.go
+4
-0
kubectl.go
test/e2e/kubectl.go
+18
-0
No files found.
pkg/util/taints/taints.go
View file @
f4d33396
...
...
@@ -43,7 +43,7 @@ func ParseTaint(st string) (v1.Taint, error) {
return
taint
,
fmt
.
Errorf
(
"invalid taint spec: %v, %s"
,
st
,
strings
.
Join
(
errs
,
"; "
))
}
if
effect
!=
v1
.
TaintEffectNoSchedule
&&
effect
!=
v1
.
TaintEffectPreferNoSchedule
{
if
effect
!=
v1
.
TaintEffectNoSchedule
&&
effect
!=
v1
.
TaintEffectPreferNoSchedule
&&
effect
!=
v1
.
TaintEffectNoExecute
{
return
taint
,
fmt
.
Errorf
(
"invalid taint spec: %v, unsupported taint effect"
,
st
)
}
...
...
pkg/util/taints/taints_test.go
View file @
f4d33396
...
...
@@ -47,6 +47,10 @@ func TestTaintsVar(t *testing.T) {
{
Key
:
"bing"
,
Value
:
"bang"
,
Effect
:
api
.
TaintEffectPreferNoSchedule
},
},
},
{
f
:
"--t=dedicated-for=user1:NoExecute"
,
t
:
[]
api
.
Taint
{{
Key
:
"dedicated-for"
,
Value
:
"user1"
,
Effect
:
"NoExecute"
}},
},
}
for
i
,
c
:=
range
cases
{
...
...
test/e2e/kubectl.go
View file @
f4d33396
...
...
@@ -1467,6 +1467,24 @@ var _ = framework.KubeDescribe("Kubectl client", func() {
}
checkOutput
(
output
,
requiredStrings
)
noExecuteTaint
:=
v1
.
Taint
{
Key
:
testTaint
.
Key
,
Value
:
"testing-taint-value-no-execute"
,
Effect
:
v1
.
TaintEffectNoExecute
,
}
By
(
"adding NoExecute taint "
+
noExecuteTaint
.
ToString
()
+
" to the node"
)
runKubectlRetryOrDie
(
"taint"
,
"nodes"
,
nodeName
,
noExecuteTaint
.
ToString
())
defer
framework
.
RemoveTaintOffNode
(
f
.
ClientSet
,
nodeName
,
noExecuteTaint
)
By
(
"verifying the node has the taint "
+
noExecuteTaint
.
ToString
())
output
=
runKubectlRetryOrDie
(
"describe"
,
"node"
,
nodeName
)
requiredStrings
=
[][]
string
{
{
"Name:"
,
nodeName
},
{
"Taints:"
},
{
noExecuteTaint
.
ToString
()},
}
checkOutput
(
output
,
requiredStrings
)
By
(
"removing all taints that have the same key "
+
testTaint
.
Key
+
" of the node"
)
runKubectlRetryOrDie
(
"taint"
,
"nodes"
,
nodeName
,
testTaint
.
Key
+
"-"
)
By
(
"verifying the node doesn't have the taints that have the same key "
+
testTaint
.
Key
)
...
...
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