@@ -42,14 +42,14 @@ import (
4242// releasableLayer.Release() to prevent leaking of layers.
4343func (i * ImageService ) GetImageAndReleasableLayer (ctx context.Context , refOrID string , opts backend.GetImageAndLayerOptions ) (builder.Image , builder.ROLayer , error ) {
4444 if refOrID == "" { // from SCRATCH
45- os := runtime .GOOS
45+ imgOS := runtime .GOOS
4646 if runtime .GOOS == "windows" {
47- os = "linux"
47+ imgOS = "linux"
4848 }
4949 if opts .Platform != nil {
50- os = opts .Platform .OS
50+ imgOS = opts .Platform .OS
5151 }
52- if ! system .IsOSSupported (os ) {
52+ if ! system .IsOSSupported (imgOS ) {
5353 return nil , nil , system .ErrNotSupportedOperatingSystem
5454 }
5555 return nil , & rolayer {
@@ -390,12 +390,12 @@ func (i *ImageService) CreateImage(ctx context.Context, config []byte, parent st
390390 return nil , err
391391 }
392392
393- rootfs := ocispec.RootFS {
393+ rootFS := ocispec.RootFS {
394394 Type : imgToCreate .RootFS .Type ,
395395 DiffIDs : []digest.Digest {},
396396 }
397397 for _ , diffId := range imgToCreate .RootFS .DiffIDs {
398- rootfs .DiffIDs = append (rootfs .DiffIDs , digest .Digest (diffId ))
398+ rootFS .DiffIDs = append (rootFS .DiffIDs , digest .Digest (diffId ))
399399 }
400400 exposedPorts := make (map [string ]struct {}, len (imgToCreate .Config .ExposedPorts ))
401401 for k , v := range imgToCreate .Config .ExposedPorts {
@@ -424,7 +424,7 @@ func (i *ImageService) CreateImage(ctx context.Context, config []byte, parent st
424424 Labels : imgToCreate .Config .Labels ,
425425 StopSignal : imgToCreate .Config .StopSignal ,
426426 },
427- RootFS : rootfs ,
427+ RootFS : rootFS ,
428428 History : imgToCreate .History ,
429429 }
430430
0 commit comments