@@ -241,18 +241,20 @@ func (s *WorkspaceService) InitWorkspace(ctx context.Context, req *api.InitWorks
241
241
}
242
242
}
243
243
244
- // create a folder that is used to store data from running prestophook
245
- deamonDir := fmt .Sprintf ("%s-daemon" , req .Id )
246
- prestophookDir := filepath .Join (s .config .WorkingArea , deamonDir , "prestophookdata" )
247
- _ , err = exec .CommandContext (ctx , "mkdir" , "-p" , prestophookDir ).CombinedOutput ()
248
- if err != nil {
249
- log .WithError (err ).WithField ("workspaceId" , req .Id ).Error ("cannot create prestophookdata folder" )
250
- return nil , status .Error (codes .FailedPrecondition , fmt .Sprintf ("cannot create prestophookdata: %v" , err ))
251
- }
252
- _ , err = exec .CommandContext (ctx , "chown" , "-R" , fmt .Sprintf ("%d:%d" , wsinit .GitpodUID , wsinit .GitpodGID ), prestophookDir ).CombinedOutput ()
253
- if err != nil {
254
- log .WithError (err ).WithField ("workspaceId" , req .Id ).Error ("cannot chown prestophookdata folder" )
255
- return nil , status .Error (codes .FailedPrecondition , fmt .Sprintf ("cannot chown prestophookdata: %v" , err ))
244
+ if req .PersistentVolumeClaim {
245
+ // create a folder that is used to store data from running prestophook
246
+ deamonDir := fmt .Sprintf ("%s-daemon" , req .Id )
247
+ prestophookDir := filepath .Join (s .config .WorkingArea , deamonDir , "prestophookdata" )
248
+ _ , err = exec .CommandContext (ctx , "mkdir" , "-p" , prestophookDir ).CombinedOutput ()
249
+ if err != nil {
250
+ log .WithError (err ).WithField ("workspaceId" , req .Id ).Error ("cannot create prestophookdata folder" )
251
+ return nil , status .Error (codes .FailedPrecondition , fmt .Sprintf ("cannot create prestophookdata: %v" , err ))
252
+ }
253
+ _ , err = exec .CommandContext (ctx , "chown" , "-R" , fmt .Sprintf ("%d:%d" , wsinit .GitpodUID , wsinit .GitpodGID ), prestophookDir ).CombinedOutput ()
254
+ if err != nil {
255
+ log .WithError (err ).WithField ("workspaceId" , req .Id ).Error ("cannot chown prestophookdata folder" )
256
+ return nil , status .Error (codes .FailedPrecondition , fmt .Sprintf ("cannot chown prestophookdata: %v" , err ))
257
+ }
256
258
}
257
259
258
260
// Tell the world we're done
0 commit comments