diff --git a/components/content-service/pkg/initializer/git.go b/components/content-service/pkg/initializer/git.go index 3f0f1916aace5a..2eade19f4cb469 100644 --- a/components/content-service/pkg/initializer/git.go +++ b/components/content-service/pkg/initializer/git.go @@ -110,7 +110,11 @@ func (ws *GitInitializer) Run(ctx context.Context, mappings []archive.IDMapping) return src, xerrors.Errorf("git initializer gitClone: %w", err) } - if ws.Chown { + defer func() { + span.SetTag("Chown", ws.Chown) + if !ws.Chown { + return + } // TODO (aledbf): refactor to remove the need of manual chown args := []string{"-R", "-L", "gitpod", ws.Location} cmd := exec.Command("chown", args...) @@ -124,7 +128,8 @@ func (ws *GitInitializer) Run(ctx context.Context, mappings []archive.IDMapping) } return } - } + }() + if err := ws.realizeCloneTarget(ctx); err != nil { return src, xerrors.Errorf("git initializer clone: %w", err) } diff --git a/components/supervisor/pkg/supervisor/supervisor.go b/components/supervisor/pkg/supervisor/supervisor.go index 6e4a974ee1a260..f2b8a229cfcc65 100644 --- a/components/supervisor/pkg/supervisor/supervisor.go +++ b/components/supervisor/pkg/supervisor/supervisor.go @@ -1325,11 +1325,9 @@ 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") } @@ -1378,7 +1376,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, doChown) + src, err = executor.Execute(ctx, "/workspace", contentFile, true) if err != nil { return }