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
62f874b1
Commit
62f874b1
authored
Jan 30, 2019
by
Michelle Au
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Mark volume as in use even when node status didn't change
parent
d388b3ee
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
17 additions
and
0 deletions
+17
-0
kubelet_node_status.go
pkg/kubelet/kubelet_node_status.go
+17
-0
No files found.
pkg/kubelet/kubelet_node_status.go
View file @
62f874b1
...
...
@@ -427,6 +427,23 @@ func (kl *Kubelet) tryUpdateNodeStatus(tryNumber int) error {
now
:=
kl
.
clock
.
Now
()
if
utilfeature
.
DefaultFeatureGate
.
Enabled
(
features
.
NodeLease
)
&&
now
.
Before
(
kl
.
lastStatusReportTime
.
Add
(
kl
.
nodeStatusReportFrequency
))
{
if
!
podCIDRChanged
&&
!
nodeStatusHasChanged
(
&
originalNode
.
Status
,
&
node
.
Status
)
{
// We must mark the volumes as ReportedInUse in volume manager's dsw even
// if no changes were made to the node status (no volumes were added or removed
// from the VolumesInUse list).
//
// The reason is that on a kubelet restart, the volume manager's dsw is
// repopulated and the volume ReportedInUse is initialized to false, while the
// VolumesInUse list from the Node object still contains the state from the
// previous kubelet instantiation.
//
// Once the volumes are added to the dsw, the ReportedInUse field needs to be
// synced from the VolumesInUse list in the Node.Status.
//
// The MarkVolumesAsReportedInUse() call cannot be performed in dsw directly
// because it does not have access to the Node object.
// This also cannot be populated on node status manager init because the volume
// may not have been added to dsw at that time.
kl
.
volumeManager
.
MarkVolumesAsReportedInUse
(
node
.
Status
.
VolumesInUse
)
return
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