Merge pull request #1758 from ygalblum/check-report-writer
Image copier: make sure ReportWriter is not nil before accessing
This commit is contained in:
commit
1b45ca4b5f
|
|
@ -364,11 +364,13 @@ func (c *copier) copy(ctx context.Context, source, destination types.ImageRefere
|
||||||
defer cancel()
|
defer cancel()
|
||||||
defer timer.Stop()
|
defer timer.Stop()
|
||||||
|
|
||||||
fmt.Fprintf(c.imageCopyOptions.ReportWriter,
|
if c.imageCopyOptions.ReportWriter != nil {
|
||||||
"Pulling image %s inside systemd: setting pull timeout to %s\n",
|
fmt.Fprintf(c.imageCopyOptions.ReportWriter,
|
||||||
source.StringWithinTransport(),
|
"Pulling image %s inside systemd: setting pull timeout to %s\n",
|
||||||
time.Duration(numExtensions)*extension,
|
source.StringWithinTransport(),
|
||||||
)
|
time.Duration(numExtensions)*extension,
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
// From `man systemd.service(5)`:
|
// From `man systemd.service(5)`:
|
||||||
//
|
//
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue