command/push: close reader

This commit is contained in:
Mitchell Hashimoto
2014-12-09 16:14:03 -08:00
parent fbc1551048
commit 0f5ef2ce2b
2 changed files with 3 additions and 3 deletions
+1
View File
@@ -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)
+2 -3
View File
@@ -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",