Skip to content

Commit

Permalink
[supervisor] fix chown of /workspace when using PVC
Browse files Browse the repository at this point in the history
  • Loading branch information
sagor999 committed Aug 19, 2022
1 parent 4b8c57a commit 32a0f89
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion components/supervisor/pkg/supervisor/supervisor.go
Original file line number Diff line number Diff line change
Expand Up @@ -1325,9 +1325,11 @@ func startContentInit(ctx context.Context, cfg *Config, wg *sync.WaitGroup, cst

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

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

log.Info("supervisor: running content service executor with content descriptor")
var src csapi.WorkspaceInitSource
src, err = executor.Execute(ctx, "/workspace", contentFile, true)
src, err = executor.Execute(ctx, "/workspace", contentFile, doChown)
if err != nil {
return
}
Expand Down

0 comments on commit 32a0f89

Please sign in to comment.