Merge pull request #83 from MiaoZhou/fixEmptyCustomPath
prevent mounting of root directory
This commit is contained in:
commit
eae7143d98
|
|
@ -104,9 +104,11 @@ func (p *nfsProvisioner) Provision(ctx context.Context, options controller.Provi
|
|||
pathPattern, exists := options.StorageClass.Parameters["pathPattern"]
|
||||
if exists {
|
||||
customPath := metadata.stringParser(pathPattern)
|
||||
if customPath != "" {
|
||||
path = filepath.Join(p.path, customPath)
|
||||
fullPath = filepath.Join(mountPath, customPath)
|
||||
}
|
||||
}
|
||||
|
||||
glog.V(4).Infof("creating path %s", fullPath)
|
||||
if err := os.MkdirAll(fullPath, 0777); err != nil {
|
||||
|
|
|
|||
Loading…
Reference in New Issue