Skip to content

Commit 370ba5e

Browse files
sagor999roboquat
authored andcommitted
[supervisor] fix chown of /workspace when using PVC
1 parent 2ee278e commit 370ba5e

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

components/supervisor/pkg/supervisor/supervisor.go

+3-1
Original file line numberDiff line numberDiff line change
@@ -1325,9 +1325,11 @@ func startContentInit(ctx context.Context, cfg *Config, wg *sync.WaitGroup, cst
13251325

13261326
fn := "/workspace/.gitpod/content.json"
13271327
fnReady := "/workspace/.gitpod/ready"
1328+
doChown := true
13281329
if _, err := os.Stat("/.workspace/.gitpod/content.json"); !os.IsNotExist(err) {
13291330
fn = "/.workspace/.gitpod/content.json"
13301331
fnReady = "/.workspace/.gitpod/ready"
1332+
doChown = false // cannot chown when using PVC as it is owned by 133332 user
13311333
log.Info("Detected content.json in /.workspace folder, assuming PVC feature enabled")
13321334
}
13331335

@@ -1376,7 +1378,7 @@ func startContentInit(ctx context.Context, cfg *Config, wg *sync.WaitGroup, cst
13761378

13771379
log.Info("supervisor: running content service executor with content descriptor")
13781380
var src csapi.WorkspaceInitSource
1379-
src, err = executor.Execute(ctx, "/workspace", contentFile, true)
1381+
src, err = executor.Execute(ctx, "/workspace", contentFile, doChown)
13801382
if err != nil {
13811383
return
13821384
}

0 commit comments

Comments
 (0)