Skip to content

Commit

Permalink
Fix empty file when using compose config in case of smaller source files
Browse files Browse the repository at this point in the history
"docker compose config --output out.yml" resulted an empty file
when the generated output was smaller than 4097 bytes.
bufio.Writer doesn't seem necessary since only one write operation will happen.
This way there is no need for a new bufio.Writer that could be flushed.

Issue #10121

Signed-off-by: Ákos Takács <takacs.akos@it-sziget.hu>
  • Loading branch information
rimelek committed Dec 29, 2022
1 parent 1d9657a commit 5fbb77e
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions cmd/compose/convert.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@
package compose

import (
"bufio"
"bytes"
"context"
"fmt"
Expand Down Expand Up @@ -145,7 +144,7 @@ func runConvert(ctx context.Context, streams api.Streams, backend api.Service, o
if err != nil {
return err
}
out = bufio.NewWriter(file)
out = io.Writer(file)
}
_, err = fmt.Fprint(out, string(content))
return err
Expand Down

0 comments on commit 5fbb77e

Please sign in to comment.