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
6d07624a
Commit
6d07624a
authored
Jan 29, 2019
by
David Ashpole
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix node e2e localstorage eviction tests
parent
d5471633
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
5 deletions
+6
-5
eviction_test.go
test/e2e_node/eviction_test.go
+6
-5
No files found.
test/e2e_node/eviction_test.go
View file @
6d07624a
...
...
@@ -171,7 +171,7 @@ var _ = framework.KubeDescribe("LocalStorageEviction [Slow] [Serial] [Disruptive
expectedStarvedResource
:=
v1
.
ResourceEphemeralStorage
Context
(
fmt
.
Sprintf
(
testContextFmt
,
expectedNodeCondition
),
func
()
{
tempSetCurrentKubeletConfig
(
f
,
func
(
initialConfig
*
kubeletconfig
.
KubeletConfiguration
)
{
diskConsumed
:=
resource
.
MustParse
(
"
1
00Mi"
)
diskConsumed
:=
resource
.
MustParse
(
"
2
00Mi"
)
summary
:=
eventuallyGetSummary
()
availableBytes
:=
*
(
summary
.
Node
.
Fs
.
AvailableBytes
)
initialConfig
.
EvictionHard
=
map
[
string
]
string
{
string
(
evictionapi
.
SignalNodeFsAvailable
)
:
fmt
.
Sprintf
(
"%d"
,
availableBytes
-
uint64
(
diskConsumed
.
Value
()))}
...
...
@@ -200,7 +200,7 @@ var _ = framework.KubeDescribe("LocalStorageSoftEviction [Slow] [Serial] [Disrup
expectedStarvedResource
:=
v1
.
ResourceEphemeralStorage
Context
(
fmt
.
Sprintf
(
testContextFmt
,
expectedNodeCondition
),
func
()
{
tempSetCurrentKubeletConfig
(
f
,
func
(
initialConfig
*
kubeletconfig
.
KubeletConfiguration
)
{
diskConsumed
:=
resource
.
MustParse
(
"
1
00Mi"
)
diskConsumed
:=
resource
.
MustParse
(
"
2
00Mi"
)
summary
:=
eventuallyGetSummary
()
availableBytes
:=
*
(
summary
.
Node
.
Fs
.
AvailableBytes
)
if
availableBytes
<=
uint64
(
diskConsumed
.
Value
())
{
...
...
@@ -459,10 +459,11 @@ func runEvictionTest(f *framework.Framework, pressureTimeout time.Duration, expe
// Sleep so that pods requesting local storage do not fail to schedule
time
.
Sleep
(
30
*
time
.
Second
)
By
(
"seting up pods to be used by tests"
)
pods
:=
[]
*
v1
.
Pod
{}
for
_
,
spec
:=
range
testSpecs
{
By
(
fmt
.
Sprintf
(
"creating pod with container: %s"
,
spec
.
pod
.
Name
))
f
.
PodClient
()
.
CreateSync
(
spec
.
pod
)
pods
=
append
(
pods
,
spec
.
pod
)
}
f
.
PodClient
()
.
CreateBatch
(
pods
)
})
It
(
"should eventually evict all of the correct pods"
,
func
()
{
...
...
@@ -831,7 +832,7 @@ func diskConsumingPod(name string, diskConsumedMB int, volumeSource *v1.VolumeSo
path
=
volumeMountPath
}
// Each iteration writes 1 Mb, so do diskConsumedMB iterations.
return
podWithCommand
(
volumeSource
,
resources
,
diskConsumedMB
,
name
,
fmt
.
Sprintf
(
"dd if=/dev/urandom of=%s${i} bs=1048576 count=1 2>/dev/null;"
,
filepath
.
Join
(
path
,
"file"
)))
return
podWithCommand
(
volumeSource
,
resources
,
diskConsumedMB
,
name
,
fmt
.
Sprintf
(
"dd if=/dev/urandom of=%s${i} bs=1048576 count=1 2>/dev/null;
sleep .1;
"
,
filepath
.
Join
(
path
,
"file"
)))
}
func
pidConsumingPod
(
name
string
,
numProcesses
int
)
*
v1
.
Pod
{
...
...
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