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
20d45af6
Unverified
Commit
20d45af6
authored
Apr 25, 2017
by
Clayton Coleman
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Combine statefulset burst and monotonic scaling tests
Use subtests to avoid duplicating entire suite of control logic.
parent
2861ae5e
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
4 additions
and
4 deletions
+4
-4
stateful_set_control_test.go
pkg/controller/statefulset/stateful_set_control_test.go
+0
-0
stateful_set_test.go
pkg/controller/statefulset/stateful_set_test.go
+3
-3
stateful_set_utils.go
pkg/controller/statefulset/stateful_set_utils.go
+1
-1
No files found.
pkg/controller/statefulset/stateful_set_control_test.go
View file @
20d45af6
This diff is collapsed.
Click to expand it.
pkg/controller/statefulset/stateful_set_test.go
View file @
20d45af6
...
...
@@ -640,7 +640,7 @@ func scaleUpStatefulSetController(set *apps.StatefulSet, ssc *StatefulSetControl
pod
=
getPodAtOrdinal
(
pods
,
ord
)
ssc
.
updatePod
(
&
prev
,
pod
)
fakeWorker
(
ssc
)
if
err
:=
assertInvariants
(
set
,
spc
);
err
!=
nil
{
if
err
:=
assert
Monotonic
Invariants
(
set
,
spc
);
err
!=
nil
{
return
err
}
if
obj
,
_
,
err
:=
spc
.
setsIndexer
.
Get
(
set
);
err
!=
nil
{
...
...
@@ -650,7 +650,7 @@ func scaleUpStatefulSetController(set *apps.StatefulSet, ssc *StatefulSetControl
}
}
return
assertInvariants
(
set
,
spc
)
return
assert
Monotonic
Invariants
(
set
,
spc
)
}
func
scaleDownStatefulSetController
(
set
*
apps
.
StatefulSet
,
ssc
*
StatefulSetController
,
spc
*
fakeStatefulPodControl
)
error
{
...
...
@@ -692,5 +692,5 @@ func scaleDownStatefulSetController(set *apps.StatefulSet, ssc *StatefulSetContr
set
=
obj
.
(
*
apps
.
StatefulSet
)
}
}
return
assertInvariants
(
set
,
spc
)
return
assert
Monotonic
Invariants
(
set
,
spc
)
}
pkg/controller/statefulset/stateful_set_utils.go
View file @
20d45af6
...
...
@@ -229,7 +229,7 @@ func isHealthy(pod *v1.Pod) bool {
// allowsBurst is true if the alpha burst annotation is set.
func
allowsBurst
(
set
*
apps
.
StatefulSet
)
bool
{
return
set
.
Annotations
[
apps
.
StatefulSetBurstAnnotation
]
==
"true"
return
set
.
Spec
.
PodManagementPolicy
==
apps
.
ParallelPodManagement
}
// newControllerRef returns an ControllerRef pointing to a given StatefulSet.
...
...
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