Skip to content

Commit a9008b5

Browse files
authored
Merge pull request kubernetes#116577 from jsafrane/fix-standalone-mode
Fix volume reconstruction in standalone mode
2 parents fe9dc2e + c4f8c3f commit a9008b5

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

pkg/kubelet/volumemanager/reconciler/reconstruct_new.go

+8
Original file line numberDiff line numberDiff line change
@@ -180,6 +180,14 @@ func (rc *reconciler) cleanOrphanVolumes() {
180180
func (rc *reconciler) updateReconstructedDevicePaths() {
181181
klog.V(4).InfoS("Updating reconstructed devicePaths")
182182

183+
if rc.kubeClient == nil {
184+
// Skip reconstructing devicePath from node objects if kubelet is in standalone mode.
185+
// Such kubelet is not expected to mount any attachable volume or Secrets / ConfigMap.
186+
klog.V(2).InfoS("Skipped reconstruction of DevicePaths from node.status in standalone mode")
187+
rc.volumesNeedDevicePath = nil
188+
return
189+
}
190+
183191
node, fetchErr := rc.kubeClient.CoreV1().Nodes().Get(context.TODO(), string(rc.nodeName), metav1.GetOptions{})
184192
if fetchErr != nil {
185193
// This may repeat few times per second until kubelet is able to read its own status for the first time.

0 commit comments

Comments
 (0)