Skip to content

Commit

Permalink
fix: local sock file path
Browse files Browse the repository at this point in the history
  • Loading branch information
Tpuljak committed Mar 6, 2024
1 parent f27baba commit 0377a2d
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion pkg/client/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import (
"path"
"provider/pkg/ssh_tunnel/util"
"provider/pkg/types"
"strings"

"github.com/docker/docker/client"

Expand Down Expand Up @@ -45,7 +46,14 @@ func getRemoteClient(targetOptions types.TargetOptions, pluginPath string) (*cli
}

func forwardDockerSock(targetOptions types.TargetOptions, pluginPath string) (string, error) {
localSockPath := path.Join(pluginPath, fmt.Sprintf("daytona-%s-docker.sock", *targetOptions.RemoteHostname))
localSockPath := path.Join(pluginPath, "target-socks", fmt.Sprintf("daytona-%s-docker.sock", strings.ReplaceAll(*targetOptions.RemoteHostname, ".", "-")))

if _, err := os.Stat(path.Dir(localSockPath)); err != nil {
err := os.MkdirAll(path.Dir(localSockPath), 0755)
if err != nil {
return "", err
}
}

if _, err := os.Stat(localSockPath); err == nil {
return localSockPath, nil
Expand Down

0 comments on commit 0377a2d

Please sign in to comment.