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
14a2b261
Commit
14a2b261
authored
Aug 15, 2016
by
derekwaynecarr
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Node controller deletePod return true if there are pods pending deletion
parent
59628744
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
2 deletions
+3
-2
controller_utils.go
pkg/controller/node/controller_utils.go
+3
-2
No files found.
pkg/controller/node/controller_utils.go
View file @
14a2b261
...
@@ -82,7 +82,7 @@ func cleanupOrphanedPods(pods []*api.Pod, nodeStore cache.Store, forcefulDeleteP
...
@@ -82,7 +82,7 @@ func cleanupOrphanedPods(pods []*api.Pod, nodeStore cache.Store, forcefulDeleteP
}
}
// deletePods will delete all pods from master running on given node, and return true
// deletePods will delete all pods from master running on given node, and return true
// if any pods were deleted.
// if any pods were deleted
, or were found pending deletion
.
func
deletePods
(
kubeClient
clientset
.
Interface
,
recorder
record
.
EventRecorder
,
nodeName
,
nodeUID
string
,
daemonStore
cache
.
StoreToDaemonSetLister
)
(
bool
,
error
)
{
func
deletePods
(
kubeClient
clientset
.
Interface
,
recorder
record
.
EventRecorder
,
nodeName
,
nodeUID
string
,
daemonStore
cache
.
StoreToDaemonSetLister
)
(
bool
,
error
)
{
remaining
:=
false
remaining
:=
false
selector
:=
fields
.
OneTermEqualSelector
(
api
.
PodHostField
,
nodeName
)
selector
:=
fields
.
OneTermEqualSelector
(
api
.
PodHostField
,
nodeName
)
...
@@ -101,8 +101,9 @@ func deletePods(kubeClient clientset.Interface, recorder record.EventRecorder, n
...
@@ -101,8 +101,9 @@ func deletePods(kubeClient clientset.Interface, recorder record.EventRecorder, n
if
pod
.
Spec
.
NodeName
!=
nodeName
{
if
pod
.
Spec
.
NodeName
!=
nodeName
{
continue
continue
}
}
// if the pod has already been
deleted, ignore it
// if the pod has already been
marked for deletion, we still return true that there are remaining pods.
if
pod
.
DeletionGracePeriodSeconds
!=
nil
{
if
pod
.
DeletionGracePeriodSeconds
!=
nil
{
remaining
=
true
continue
continue
}
}
// if the pod is managed by a daemonset, ignore it
// if the pod is managed by a daemonset, ignore it
...
...
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