Skip to content

Commit

Permalink
Merge pull request #307 from pohly/node-publish-volume-target-dir
Browse files Browse the repository at this point in the history
NodePublishVolume: require parents of target directory to exist
  • Loading branch information
k8s-ci-robot authored May 27, 2021
2 parents cca14dd + 147b1d0 commit 15b660f
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion pkg/hostpath/nodeserver.go
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@ func (hp *hostPath) NodePublishVolume(ctx context.Context, req *csi.NodePublishV
notMnt, err := mount.IsNotMountPoint(mount.New(""), targetPath)
if err != nil {
if os.IsNotExist(err) {
if err = os.MkdirAll(targetPath, 0750); err != nil {
if err = os.Mkdir(targetPath, 0750); err != nil {
return nil, fmt.Errorf("create target path: %w", err)
}
notMnt = true
Expand Down

0 comments on commit 15b660f

Please sign in to comment.