Skip to content

Commit

Permalink
Merge pull request #238 from antmoveh/master
Browse files Browse the repository at this point in the history
Reset directory permissions
  • Loading branch information
k8s-ci-robot authored Oct 18, 2021
2 parents 85cd36e + ee1b589 commit 2c0449e
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions pkg/nfs/controllerserver.go
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,10 @@ func (cs *ControllerServer) CreateVolume(ctx context.Context, req *csi.CreateVol
if err = os.Mkdir(internalVolumePath, 0777); err != nil && !os.IsExist(err) {
return nil, status.Errorf(codes.Internal, "failed to make subdirectory: %v", err.Error())
}
// Reset directory permissions because of umask problems
if err = os.Chmod(internalVolumePath, 0777); err != nil {
klog.Warningf("failed to chmod subdirectory: %v", err.Error())
}
return &csi.CreateVolumeResponse{Volume: cs.nfsVolToCSI(nfsVol)}, nil
}

Expand Down

0 comments on commit 2c0449e

Please sign in to comment.