New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Mark reconstructed volumes as reported InUse #60888
Mark reconstructed volumes as reported InUse #60888
Conversation
When a newly started kubelet finds a directory where a volume should be, it can be fairly confident that the volume was mounted by previous kubelet and therefore the volume must have been in node.status.volumesInUse. Therefore we can mark reconstructed volumes as already reported so subsequent reconcile() can fix the directory and put the mounted volume into actual state of world.
/lgtm |
/milestone v1.10 |
/test pull-kubernetes-e2e-gce |
glog.Warningf("Could not construct volume information, cleanup the mounts. (pod.UID %s, volume.SpecName %s): %v", volume.podName, volume.volumeSpecName, err) | ||
rc.cleanupMounts(volume) | ||
continue | ||
} | ||
if volumeInDSW { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should we move this part right after line 367? If desired state has the volume and the volume directory already exist, we can mark the ReportInUse in the desired state.
Ideally, we can check node status to make sure the reportinuse field has the volume
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I originally put it here because I did not want volumes that failed reconstruction to be reported. I'll move the check up as you suggest.
c51e843
to
197909e
Compare
197909e
to
c51e843
Compare
Oh, NOW I remember why the code is as it is! Without successful reconstruction I don't have I reverted the PR back to the original state. |
/test pull-kubernetes-e2e-kops-aws |
/lgtm |
/approve |
@saad-ali can you approve this PR? |
/approve |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: gnufied, jingxu97, jsafrane, saad-ali The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
[MILESTONENOTIFIER] Milestone Pull Request: Up-to-date for process Pull Request Labels
|
Automatic merge from submit-queue (batch tested with PRs 60888, 61225). If you want to cherry-pick this change to another branch, please follow the instructions here. |
When a newly started kubelet finds a directory where a volume should be,
it can be fairly confident that the volume was mounted by previous kubelet
and therefore the volume must have been in node.status.volumesInUse.
Therefore we can mark reconstructed volumes as already reported so
subsequent reconcile() can fix the directory and put the mounted volume
into actual state of world.
Fixes: #60645
Release note:
/sig storage
/sig node
cc: @gnufied @jingxu97