Skip to content

Commit

Permalink
fix(pro): local folder upload works properly now with pro
Browse files Browse the repository at this point in the history
The problem was that we correctly put the uploaded local folder under
the workspace directory /var/lib/loft/devpod/$WORKSPACE_ID/agent/.. but
when we established the SSH connection we attempted to create the actual
local workspace folder on the runner side.
Because we usually only have write access to /var/lib/loft remotely this
causes permission issues and `devpod ssh` to fail.
  • Loading branch information
pascalbreuninger committed Jan 24, 2025
1 parent d6fbe6a commit 13ccbf0
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions pkg/agent/agent.go
Original file line number Diff line number Diff line change
Expand Up @@ -185,8 +185,12 @@ func decodeWorkspaceInfoAndWrite(
}
}

// check content folder
if workspaceInfo.Workspace.Source.LocalFolder != "" {
// check content folder for local folder workspace source
//
// We don't want to initialize the content folder with the value of the local workspace folder
// if we're running in proxy mode.
// We only have write access to /var/lib/loft/* by default causing nearly all local folders to run into permissions issues
if workspaceInfo.Workspace.Source.LocalFolder != "" && !workspaceInfo.CLIOptions.Proxy {
_, err = os.Stat(workspaceInfo.WorkspaceOrigin)
if err == nil {
workspaceInfo.ContentFolder = workspaceInfo.Workspace.Source.LocalFolder
Expand Down

0 comments on commit 13ccbf0

Please sign in to comment.