mirror of
https://github.com/hashicorp/packer.git
synced 2026-06-10 17:20:26 -04:00
command/push: close reader
This commit is contained in:
parent
fbc1551048
commit
0f5ef2ce2b
2 changed files with 3 additions and 3 deletions
|
|
@ -83,6 +83,7 @@ func (c *PushCommand) Run(args []string) int {
|
|||
c.Ui.Error(fmt.Sprintf("Error archiving: %s", err))
|
||||
return 1
|
||||
}
|
||||
defer r.Close()
|
||||
|
||||
// Start the upload process
|
||||
doneCh, uploadErrCh, err := c.upload(r, &uploadOpts)
|
||||
|
|
|
|||
|
|
@ -29,10 +29,10 @@ func TestPush_multiArgs(t *testing.T) {
|
|||
}
|
||||
|
||||
func TestPush(t *testing.T) {
|
||||
var actualR io.Reader
|
||||
var actual []string
|
||||
var actualOpts *uploadOpts
|
||||
uploadFn := func(r io.Reader, opts *uploadOpts) (<-chan struct{}, <-chan error, error) {
|
||||
actualR = r
|
||||
actual = testArchive(t, r)
|
||||
actualOpts = opts
|
||||
|
||||
doneCh := make(chan struct{})
|
||||
|
|
@ -50,7 +50,6 @@ func TestPush(t *testing.T) {
|
|||
fatalCommand(t, c.Meta)
|
||||
}
|
||||
|
||||
actual := testArchive(t, actualR)
|
||||
expected := []string{
|
||||
archiveTemplateEntry,
|
||||
"template.json",
|
||||
|
|
|
|||
Loading…
Reference in a new issue