Skip to content

Commit

Permalink
Revert "Revert "[supervisor] fix chown of /workspace when using PVC""
Browse files Browse the repository at this point in the history
This reverts commit c33cb46.
  • Loading branch information
jenting committed Aug 26, 2022
1 parent 2cacbb3 commit 324a46c
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 324a46c

Please sign in to comment.