Skip to content

Commit

Permalink
fix: Do not create base folder on remote when uploading dir
Browse files Browse the repository at this point in the history
Calling lxc files push dir/ instance:/tmp/abc will create folder
/tmp/abc/dir with all files inside which does not match behavior
expected by Packer - files should be placed directly under /tmp/abc.

Use lxc files push dir/* to upload files to proper directory
  • Loading branch information
Novakov committed Aug 29, 2023
1 parent 397a10e commit 1aff2a4
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion builder/lxd/communicator.go
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ func (c *Communicator) Upload(dst string, r io.Reader, fi *os.FileInfo) error {

func (c *Communicator) UploadDir(dst string, src string, exclude []string) error {
fileDestination := fmt.Sprintf("%s/%s", c.ContainerName, dst)
pushCommand := fmt.Sprintf("lxc file push --debug -pr %s %s", src, fileDestination)
pushCommand := fmt.Sprintf("lxc file push --debug -pr %s* %s", src, fileDestination)
log.Printf(pushCommand)
cp, err := c.CmdWrapper(pushCommand)
if err != nil {
Expand Down

0 comments on commit 1aff2a4

Please sign in to comment.