Image copier: make sure ReportWriter is not nil before accessing
When running in Quiet mode, the ReportWriter can be nil causing a crash Signed-off-by: Ygal Blum <ygal.blum@gmail.com>
This commit is contained in:
parent
b89e527ab7
commit
a525f15fc3
|
|
@ -364,11 +364,13 @@ func (c *copier) copy(ctx context.Context, source, destination types.ImageRefere
|
|||
defer cancel()
|
||||
defer timer.Stop()
|
||||
|
||||
fmt.Fprintf(c.imageCopyOptions.ReportWriter,
|
||||
"Pulling image %s inside systemd: setting pull timeout to %s\n",
|
||||
source.StringWithinTransport(),
|
||||
time.Duration(numExtensions)*extension,
|
||||
)
|
||||
if c.imageCopyOptions.ReportWriter != nil {
|
||||
fmt.Fprintf(c.imageCopyOptions.ReportWriter,
|
||||
"Pulling image %s inside systemd: setting pull timeout to %s\n",
|
||||
source.StringWithinTransport(),
|
||||
time.Duration(numExtensions)*extension,
|
||||
)
|
||||
}
|
||||
|
||||
// From `man systemd.service(5)`:
|
||||
//
|
||||
|
|
|
|||
Loading…
Reference in New Issue