Skip to content

Commit

Permalink
Merge pull request kubernetes-sigs#83 from MiaoZhou/fixEmptyCustomPath
Browse files Browse the repository at this point in the history
prevent mounting of root directory
  • Loading branch information
k8s-ci-robot authored Apr 2, 2021
2 parents 888d6db + b8e2036 commit eae7143
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions cmd/nfs-subdir-external-provisioner/provisioner.go
Original file line number Diff line number Diff line change
Expand Up @@ -104,8 +104,10 @@ func (p *nfsProvisioner) Provision(ctx context.Context, options controller.Provi
pathPattern, exists := options.StorageClass.Parameters["pathPattern"]
if exists {
customPath := metadata.stringParser(pathPattern)
path = filepath.Join(p.path, customPath)
fullPath = filepath.Join(mountPath, customPath)
if customPath != "" {
path = filepath.Join(p.path, customPath)
fullPath = filepath.Join(mountPath, customPath)
}
}

glog.V(4).Infof("creating path %s", fullPath)
Expand Down

0 comments on commit eae7143

Please sign in to comment.