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
594234d6
Commit
594234d6
authored
Aug 17, 2016
by
Chao Xu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix tests; convert IsPodActive to operate on *Pod
parent
33108372
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
10 additions
and
6 deletions
+10
-6
controller_ref_manager.go
pkg/controller/controller_ref_manager.go
+1
-1
controller_utils.go
pkg/controller/controller_utils.go
+2
-2
controller_utils_test.go
pkg/controller/controller_utils_test.go
+5
-1
deployment_util.go
pkg/controller/deployment/util/deployment_util.go
+1
-1
util.go
test/e2e/framework/util.go
+1
-1
No files found.
pkg/controller/controller_ref_manager.go
View file @
594234d6
...
...
@@ -59,7 +59,7 @@ func (m *PodControllerRefManager) Classify(pods []*api.Pod) (
controlledDoesNotMatch
[]
*
api
.
Pod
)
{
for
i
:=
range
pods
{
pod
:=
pods
[
i
]
if
!
IsPodActive
(
*
pod
)
{
if
!
IsPodActive
(
pod
)
{
glog
.
V
(
4
)
.
Infof
(
"Ignoring inactive pod %v/%v in state %v, deletion time %v"
,
pod
.
Namespace
,
pod
.
Name
,
pod
.
Status
.
Phase
,
pod
.
DeletionTimestamp
)
continue
...
...
pkg/controller/controller_utils.go
View file @
594234d6
...
...
@@ -686,7 +686,7 @@ func maxContainerRestarts(pod *api.Pod) int {
func
FilterActivePods
(
pods
[]
*
api
.
Pod
)
[]
*
api
.
Pod
{
var
result
[]
*
api
.
Pod
for
_
,
p
:=
range
pods
{
if
IsPodActive
(
*
p
)
{
if
IsPodActive
(
p
)
{
result
=
append
(
result
,
p
)
}
else
{
glog
.
V
(
4
)
.
Infof
(
"Ignoring inactive pod %v/%v in state %v, deletion time %v"
,
...
...
@@ -696,7 +696,7 @@ func FilterActivePods(pods []*api.Pod) []*api.Pod {
return
result
}
func
IsPodActive
(
p
api
.
Pod
)
bool
{
func
IsPodActive
(
p
*
api
.
Pod
)
bool
{
return
api
.
PodSucceeded
!=
p
.
Status
.
Phase
&&
api
.
PodFailed
!=
p
.
Status
.
Phase
&&
p
.
DeletionTimestamp
==
nil
...
...
pkg/controller/controller_utils_test.go
View file @
594234d6
...
...
@@ -287,7 +287,11 @@ func TestActivePodFiltering(t *testing.T) {
expectedNames
.
Insert
(
pod
.
Name
)
}
got
:=
FilterActivePods
(
podList
.
Items
)
var
podPointers
[]
*
api
.
Pod
for
i
:=
range
podList
.
Items
{
podPointers
=
append
(
podPointers
,
&
podList
.
Items
[
i
])
}
got
:=
FilterActivePods
(
podPointers
)
gotNames
:=
sets
.
NewString
()
for
_
,
pod
:=
range
got
{
gotNames
.
Insert
(
pod
.
Name
)
...
...
pkg/controller/deployment/util/deployment_util.go
View file @
594234d6
...
...
@@ -633,7 +633,7 @@ func countAvailablePods(pods []api.Pod, minReadySeconds int32) int32 {
// IsPodAvailable return true if the pod is available.
func
IsPodAvailable
(
pod
*
api
.
Pod
,
minReadySeconds
int32
,
now
time
.
Time
)
bool
{
if
!
controller
.
IsPodActive
(
*
pod
)
{
if
!
controller
.
IsPodActive
(
pod
)
{
return
false
}
// Check if we've passed minReadySeconds since LastTransitionTime
...
...
test/e2e/framework/util.go
View file @
594234d6
...
...
@@ -3166,7 +3166,7 @@ func waitForPodsInactive(ps *PodStore, interval, timeout time.Duration) error {
return
wait
.
PollImmediate
(
interval
,
timeout
,
func
()
(
bool
,
error
)
{
pods
:=
ps
.
List
()
for
_
,
pod
:=
range
pods
{
if
controller
.
IsPodActive
(
*
pod
)
{
if
controller
.
IsPodActive
(
pod
)
{
return
false
,
nil
}
}
...
...
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