Merge pull request #108442 from NikhilSharmaWe/volMan

Managing nil pointer in VolumeManager
This commit is contained in:
Kubernetes Prow Robot 2022-03-23 13:21:55 -07:00 committed by GitHub
commit 2f7d53bbf1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -604,7 +604,11 @@ func getDeviceMountPath(volume *reconstructedVolume) (string, error) {
func (rc *reconciler) updateStates(volumesNeedUpdate map[v1.UniqueVolumeName]*reconstructedVolume) error {
// Get the node status to retrieve volume device path information.
rc.updateDevicePath(volumesNeedUpdate)
// Skip reporting devicePath in node objects if kubeClient is nil.
// In standalone mode, kubelet is not expected to mount any attachable volume types or secret, configmaps etc.
if rc.kubeClient != nil {
rc.updateDevicePath(volumesNeedUpdate)
}
for _, volume := range volumesNeedUpdate {
err := rc.actualStateOfWorld.MarkVolumeAsAttached(