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
44732e25
Commit
44732e25
authored
Jun 05, 2018
by
Janet Kuo
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Skip updating status for DaemonSet being deleted
parent
c2a8c9ce
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
13 additions
and
1 deletion
+13
-1
daemon_controller.go
pkg/controller/daemon/daemon_controller.go
+13
-1
No files found.
pkg/controller/daemon/daemon_controller.go
View file @
44732e25
...
@@ -1142,6 +1142,18 @@ func (dsc *DaemonSetsController) syncDaemonSet(key string) error {
...
@@ -1142,6 +1142,18 @@ func (dsc *DaemonSetsController) syncDaemonSet(key string) error {
return
fmt
.
Errorf
(
"couldn't get key for object %#v: %v"
,
ds
,
err
)
return
fmt
.
Errorf
(
"couldn't get key for object %#v: %v"
,
ds
,
err
)
}
}
// If the DaemonSet is being deleted (either by foreground deletion or
// orphan deletion), we cannot be sure if the DaemonSet history objects
// it owned still exist -- those history objects can either be deleted
// or orphaned. Garbage collector doesn't guarantee that it will delete
// DaemonSet pods before deleting DaemonSet history objects, because
// DaemonSet history doesn't own DaemonSet pods. We cannot reliably
// calculate the status of a DaemonSet being deleted. Therefore, return
// here without updating status for the DaemonSet being deleted.
if
ds
.
DeletionTimestamp
!=
nil
{
return
nil
}
// Construct histories of the DaemonSet, and get the hash of current history
// Construct histories of the DaemonSet, and get the hash of current history
cur
,
old
,
err
:=
dsc
.
constructHistory
(
ds
)
cur
,
old
,
err
:=
dsc
.
constructHistory
(
ds
)
if
err
!=
nil
{
if
err
!=
nil
{
...
@@ -1149,7 +1161,7 @@ func (dsc *DaemonSetsController) syncDaemonSet(key string) error {
...
@@ -1149,7 +1161,7 @@ func (dsc *DaemonSetsController) syncDaemonSet(key string) error {
}
}
hash
:=
cur
.
Labels
[
apps
.
DefaultDaemonSetUniqueLabelKey
]
hash
:=
cur
.
Labels
[
apps
.
DefaultDaemonSetUniqueLabelKey
]
if
ds
.
DeletionTimestamp
!=
nil
||
!
dsc
.
expectations
.
SatisfiedExpectations
(
dsKey
)
{
if
!
dsc
.
expectations
.
SatisfiedExpectations
(
dsKey
)
{
// Only update status.
// Only update status.
return
dsc
.
updateDaemonSetStatus
(
ds
,
hash
)
return
dsc
.
updateDaemonSetStatus
(
ds
,
hash
)
}
}
...
...
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