Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 8 additions & 4 deletions pkg/compose/build_bake.go
Original file line number Diff line number Diff line change
Expand Up @@ -447,21 +447,25 @@ type _console struct {
*streams.Out
}

func (c _console) Read(p []byte) (n int, err error) {
func (c *_console) Read(p []byte) (n int, err error) {
return 0, errors.New("not implemented")
}

func (c _console) Close() error {
func (c *_console) Close() error {
return nil
}

func (c _console) Fd() uintptr {
func (c *_console) Fd() uintptr {
return c.FD()
}

func (c _console) Name() string {
func (c *_console) Name() string {
return "compose"
}
func (c *_console) File() *os.File {
// streams.Out wraps the actual file. We attempt to unwrap it.
return os.NewFile(c.Out.FD(), "compose")
Comment on lines +466 to +467
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this could lead to resource leaks or unexpected behavior if the file descriptor is closed prematurely. The comment acknowledges the wrapping, but this assumes streams.Out.FD() always points to a valid console file.

}

func toBakeExtraHosts(hosts types.HostsList) map[string]string {
m := make(map[string]string)
Expand Down