daemon/containerd: rename some vars that collided with imports

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
This commit is contained in:
Sebastiaan van Stijn 2023-08-25 01:02:30 +02:00
parent aefbd49038
commit e10eca3d1a
No known key found for this signature in database
GPG key ID: 76698F39D527CE8C
2 changed files with 9 additions and 9 deletions

View file

@ -42,14 +42,14 @@ import (
// releasableLayer.Release() to prevent leaking of layers.
func (i *ImageService) GetImageAndReleasableLayer(ctx context.Context, refOrID string, opts backend.GetImageAndLayerOptions) (builder.Image, builder.ROLayer, error) {
if refOrID == "" { // from SCRATCH
os := runtime.GOOS
imgOS := runtime.GOOS
if runtime.GOOS == "windows" {
os = "linux"
imgOS = "linux"
}
if opts.Platform != nil {
os = opts.Platform.OS
imgOS = opts.Platform.OS
}
if !system.IsOSSupported(os) {
if !system.IsOSSupported(imgOS) {
return nil, nil, system.ErrNotSupportedOperatingSystem
}
return nil, &rolayer{
@ -390,12 +390,12 @@ func (i *ImageService) CreateImage(ctx context.Context, config []byte, parent st
return nil, err
}
rootfs := ocispec.RootFS{
rootFS := ocispec.RootFS{
Type: imgToCreate.RootFS.Type,
DiffIDs: []digest.Digest{},
}
for _, diffId := range imgToCreate.RootFS.DiffIDs {
rootfs.DiffIDs = append(rootfs.DiffIDs, digest.Digest(diffId))
rootFS.DiffIDs = append(rootFS.DiffIDs, digest.Digest(diffId))
}
exposedPorts := make(map[string]struct{}, len(imgToCreate.Config.ExposedPorts))
for k, v := range imgToCreate.Config.ExposedPorts {
@ -424,7 +424,7 @@ func (i *ImageService) CreateImage(ctx context.Context, config []byte, parent st
Labels: imgToCreate.Config.Labels,
StopSignal: imgToCreate.Config.StopSignal,
},
RootFS: rootfs,
RootFS: rootFS,
History: imgToCreate.History,
}

View file

@ -259,9 +259,9 @@ func compressAndWriteBlob(ctx context.Context, cs content.Store, compression arc
writeChan := make(chan digest.Digest)
// Start copying the blob to the content store from the pipe.
go func() {
digest, err := writeBlobAndReturnDigest(ctx, cs, mediaType, pr)
dgst, err := writeBlobAndReturnDigest(ctx, cs, mediaType, pr)
pr.CloseWithError(err)
writeChan <- digest
writeChan <- dgst
}()
// Copy archive to the pipe and tee it to a digester.