Commit 809d259d authored by Kubernetes Submit Queue's avatar Kubernetes Submit Queue Committed by GitHub

Merge pull request #38338 from vmware/FixSpaceInVolumePathMaster

Automatic merge from submit-queue (batch tested with PRs 36310, 37349, 38319, 38402, 38338) Fix space issue in volumePath with vSphere Cloud Provider I tried to create a kubernetes deployment with vSphere volume with volume path "[datastore] kubevols/redis-master". In this case the cloud provider queries the getDeviceNameFromMount() to return the path of the volume mounted. Since getDeviceNameFromMount() queries the filesystem to get the mount references, it returns a volume path "[datastore]\\040kubevols/redis-master". Later the kubelet searches for this volume path in both the actual and desired states. Th actual and desired states contains volume with path "[datastore] kubevols/redis-master". So, it couldn't find such volume path and therefore kubernetes stalls unable to make any progress further similar to one described in #37022. This PR will fix the space issue in volume path by replacing \\040 to empty space. This fixes #37712. Also fixes #38148 @kerneltime @pdhamdhere
parents 9c166ddf 4d57ad6f
...@@ -20,6 +20,7 @@ import ( ...@@ -20,6 +20,7 @@ import (
"fmt" "fmt"
"os" "os"
"path" "path"
"strings"
"github.com/golang/glog" "github.com/golang/glog"
"k8s.io/kubernetes/pkg/api/resource" "k8s.io/kubernetes/pkg/api/resource"
...@@ -125,6 +126,7 @@ func (plugin *vsphereVolumePlugin) ConstructVolumeSpec(volumeName, mountPath str ...@@ -125,6 +126,7 @@ func (plugin *vsphereVolumePlugin) ConstructVolumeSpec(volumeName, mountPath str
if err != nil { if err != nil {
return nil, err return nil, err
} }
volumePath = strings.Replace(volumePath, "\\040", " ", -1)
glog.V(5).Infof("vSphere volume path is %q", volumePath) glog.V(5).Infof("vSphere volume path is %q", volumePath)
vsphereVolume := &v1.Volume{ vsphereVolume := &v1.Volume{
Name: volumeName, Name: volumeName,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment