Skip to content

Commit

Permalink
cat instead of sleep to deadspin
Browse files Browse the repository at this point in the history
  • Loading branch information
BeryJu committed Nov 7, 2022
1 parent 391275b commit 384377f
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 7 deletions.
2 changes: 1 addition & 1 deletion mover/entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
if [[ $1 == "sync" ]]; then
rsync -aHA --progress /source/ /dest
elif [[ $1 == "sleep" ]]; then
sleep infinity
cat
else
echo "No command given. Make sure to use the correct mover image for your korb version."
exit 1
Expand Down
9 changes: 6 additions & 3 deletions pkg/strategies/export.go
Original file line number Diff line number Diff line change
Expand Up @@ -76,9 +76,12 @@ func (c *ExportStrategy) CopyOut(pod v1.Pod, config *rest.Config, name string) (
-1,
"downloading",
)
err = c.tempMover.Exec(pod, config, []string{
"tar", "cvf", "-", mover.SourceMount,
}, nil, io.MultiWriter(file, bar))
cmd := []string{
"bash",
"-c",
fmt.Sprintf("cd \"%s\" && tar cvf - .", mover.SourceMount),
}
err = c.tempMover.Exec(pod, config, cmd, nil, io.MultiWriter(file, bar))
if err != nil {
return "", err
}
Expand Down
9 changes: 6 additions & 3 deletions pkg/strategies/import.go
Original file line number Diff line number Diff line change
Expand Up @@ -74,9 +74,12 @@ func (c *ImportStrategy) CopyInto(pod v1.Pod, config *rest.Config, localPath str
return err
}
defer file.Close()
err = c.tempMover.Exec(pod, config, []string{
"tar", "xvf", "-",
}, file, os.Stdout)
cmd := []string{
"bash",
"-c",
fmt.Sprintf("cd \"%s\" && tar xvf -", mover.SourceMount),
}
err = c.tempMover.Exec(pod, config, cmd, file, os.Stdout)
if err != nil {
return err
}
Expand Down

0 comments on commit 384377f

Please sign in to comment.