Skip to content

Commit

Permalink
Absolute path for Source dir (#126)
Browse files Browse the repository at this point in the history
Signed-off-by: Ketan Umare <ketan.umare@gmail.com>
  • Loading branch information
kumare3 authored Jul 1, 2021
1 parent 29740e0 commit 2a25558
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion flytectl/cmd/sandbox/start.go
Original file line number Diff line number Diff line change
@@ -6,6 +6,7 @@ import (
"fmt"
"io"
"os"
"path/filepath"

"github.com/flyteorg/flytectl/pkg/docker"

@@ -67,19 +68,25 @@ func startSandbox(ctx context.Context, cli docker.Docker, reader io.Reader) (*bu
}

if len(sandboxConfig.DefaultConfig.Source) > 0 {
source, err := filepath.Abs(sandboxConfig.DefaultConfig.Source)
if err != nil {
return nil, err
}
docker.Volumes = append(docker.Volumes, mount.Mount{
Type: mount.TypeBind,
Source: sandboxConfig.DefaultConfig.Source,
Source: source,
Target: docker.FlyteSnackDir,
})
}

fmt.Printf("%v pulling docker image %s\n", emoji.Whale, docker.ImageName)
os.Setenv("KUBECONFIG", docker.Kubeconfig)
os.Setenv("FLYTECTL_CONFIG", docker.FlytectlConfig)
if err := docker.PullDockerImage(ctx, cli, docker.ImageName); err != nil {
return nil, err
}

fmt.Printf("%v booting Flyte-sandbox container\n", emoji.FactoryWorker)
exposedPorts, portBindings, _ := docker.GetSandboxPorts()
ID, err := docker.StartContainer(ctx, cli, docker.Volumes, exposedPorts, portBindings, docker.FlyteSandboxClusterName, docker.ImageName)
if err != nil {

0 comments on commit 2a25558

Please sign in to comment.