Skip to content
Closed
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
8 changes: 7 additions & 1 deletion pkg/bootc/bootc_disk.go
Original file line number Diff line number Diff line change
Expand Up @@ -340,9 +340,15 @@ func (p *BootcDisk) runInstallContainer(quiet bool, config DiskImageConfig) (err
attachCancelCtx, cancelAttach := context.WithCancel(p.Ctx)
defer cancelAttach()
var exitCode int32

nilFile, err := os.Open(os.DevNull)
if err != nil {
return fmt.Errorf("unable to open /dev/null: %w", err)
}

if !quiet {
attachOpts := new(containers.AttachOptions).WithStream(true)
if err := containers.Attach(attachCancelCtx, p.bootcInstallContainerId, os.Stdin, os.Stdout, os.Stderr, nil, attachOpts); err != nil {
if err := containers.Attach(attachCancelCtx, p.bootcInstallContainerId, nilFile, os.Stdout, os.Stderr, nil, attachOpts); err != nil {
return fmt.Errorf("attaching: %w", err)
}
}
Expand Down