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