From 32a0f897780ac0e7f5dc5e9a5d90ae9e1a8c1d8f Mon Sep 17 00:00:00 2001 From: "Pavel Tumik @ GitPod" <18602811+sagor999@users.noreply.github.com> Date: Fri, 19 Aug 2022 15:09:36 -0700 Subject: [PATCH] [supervisor] fix chown of /workspace when using PVC --- components/supervisor/pkg/supervisor/supervisor.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/components/supervisor/pkg/supervisor/supervisor.go b/components/supervisor/pkg/supervisor/supervisor.go index f2b8a229cfcc65..6e4a974ee1a260 100644 --- a/components/supervisor/pkg/supervisor/supervisor.go +++ b/components/supervisor/pkg/supervisor/supervisor.go @@ -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") } @@ -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 }