Skip to content

Commit

Permalink
fix creating /var/lib/directpv/mnt directory prior to sync (#734)
Browse files Browse the repository at this point in the history
  • Loading branch information
Praveenrajmani authored Mar 26, 2023
1 parent 14a30f9 commit ae995d5
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions cmd/directpv/node-server.go
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,9 @@ var nodeServerCmd = &cobra.Command{
SilenceUsage: true,
SilenceErrors: true,
RunE: func(c *cobra.Command, args []string) error {
if err := sys.Mkdir(consts.MountRootDir, 0o755); err != nil && !errors.Is(err, os.ErrExist) {
return err
}
if err := device.Sync(c.Context(), nodeID); err != nil {
return err
}
Expand Down Expand Up @@ -94,10 +97,6 @@ func startNodeServer(ctx context.Context) error {
)
klog.V(3).Infof("Node server started")

if err = sys.Mkdir(consts.MountRootDir, 0o755); err != nil && !errors.Is(err, os.ErrExist) {
return err
}

go func() {
if err := runServers(ctx, csiEndpoint, idServer, nil, nodeServer); err != nil {
klog.ErrorS(err, "unable to start GRPC servers")
Expand Down

0 comments on commit ae995d5

Please sign in to comment.