Skip to content

Commit

Permalink
fix: add missed null check in docker_image_dest.go
Browse files Browse the repository at this point in the history
As the documentation says, "It is always OK to pass nil instead of a SystemContext."

Signed-off-by: Bojidar Marinov <bojidar.marinov.bg@gmail.com>
  • Loading branch information
bojidar-bg committed Oct 30, 2023
1 parent 05d7a1f commit 13264a1
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion docker/docker_image_dest.go
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ func (d *dockerImageDestination) PutBlobWithOptions(ctx context.Context, stream
// If requested, precompute the blob digest to prevent uploading layers that already exist on the registry.
// This functionality is particularly useful when BlobInfoCache has not been populated with compressed digests,
// the source blob is uncompressed, and the destination blob is being compressed "on the fly".
if inputInfo.Digest == "" && d.c.sys.DockerRegistryPushPrecomputeDigests {
if inputInfo.Digest == "" && d.c.sys != nil && d.c.sys.DockerRegistryPushPrecomputeDigests {
logrus.Debugf("Precomputing digest layer for %s", reference.Path(d.ref.ref))
streamCopy, cleanup, err := streamdigest.ComputeBlobInfo(d.c.sys, stream, &inputInfo)
if err != nil {
Expand Down

0 comments on commit 13264a1

Please sign in to comment.