@@ -56,7 +56,7 @@ type CopyInput interface {
5656}
5757
5858type subAction interface {
59- toProtoAction (ctx context.Context , parent string , base pb.InputIndex , platform string ) (pb.IsFileAction , error )
59+ toProtoAction (ctx context.Context , parent string , base pb.InputIndex , platformOS string ) (pb.IsFileAction , error )
6060}
6161
6262type capAdder interface {
@@ -162,8 +162,8 @@ type fileActionMkdir struct {
162162 info MkdirInfo
163163}
164164
165- func (a * fileActionMkdir ) toProtoAction (ctx context.Context , parent string , base pb.InputIndex , platform string ) (pb.IsFileAction , error ) {
166- normalizedPath , err := system .NormalizePath (parent , a .file , platform , false )
165+ func (a * fileActionMkdir ) toProtoAction (ctx context.Context , parent string , base pb.InputIndex , platformOS string ) (pb.IsFileAction , error ) {
166+ normalizedPath , err := system .NormalizePath (parent , a .file , platformOS , false )
167167 if err != nil {
168168 return nil , errors .Wrap (err , "normalizing path" )
169169 }
@@ -340,8 +340,8 @@ type fileActionMkfile struct {
340340 info MkfileInfo
341341}
342342
343- func (a * fileActionMkfile ) toProtoAction (ctx context.Context , parent string , base pb.InputIndex , platform string ) (pb.IsFileAction , error ) {
344- normalizedPath , err := system .NormalizePath (parent , a .file , platform , false )
343+ func (a * fileActionMkfile ) toProtoAction (ctx context.Context , parent string , base pb.InputIndex , platformOS string ) (pb.IsFileAction , error ) {
344+ normalizedPath , err := system .NormalizePath (parent , a .file , platformOS , false )
345345 if err != nil {
346346 return nil , errors .Wrap (err , "normalizing path" )
347347 }
@@ -412,8 +412,8 @@ type fileActionRm struct {
412412 info RmInfo
413413}
414414
415- func (a * fileActionRm ) toProtoAction (ctx context.Context , parent string , base pb.InputIndex , platform string ) (pb.IsFileAction , error ) {
416- normalizedPath , err := system .NormalizePath (parent , a .file , platform , false )
415+ func (a * fileActionRm ) toProtoAction (ctx context.Context , parent string , base pb.InputIndex , platformOS string ) (pb.IsFileAction , error ) {
416+ normalizedPath , err := system .NormalizePath (parent , a .file , platformOS , false )
417417 if err != nil {
418418 return nil , errors .Wrap (err , "normalizing path" )
419419 }
@@ -506,12 +506,12 @@ type fileActionCopy struct {
506506 info CopyInfo
507507}
508508
509- func (a * fileActionCopy ) toProtoAction (ctx context.Context , parent string , base pb.InputIndex , platform string ) (pb.IsFileAction , error ) {
510- src , err := a .sourcePath (ctx , platform )
509+ func (a * fileActionCopy ) toProtoAction (ctx context.Context , parent string , base pb.InputIndex , platformOS string ) (pb.IsFileAction , error ) {
510+ src , err := a .sourcePath (ctx , platformOS )
511511 if err != nil {
512512 return nil , err
513513 }
514- normalizedPath , err := system .NormalizePath (parent , a .dest , platform , false )
514+ normalizedPath , err := system .NormalizePath (parent , a .dest , platformOS , false )
515515 if err != nil {
516516 return nil , errors .Wrap (err , "normalizing path" )
517517 }
@@ -773,11 +773,11 @@ func (f *FileOp) Marshal(ctx context.Context, c *Constraints) (digest.Digest, []
773773 }
774774
775775 // Assume that we're building an image for the same OS we're running on.
776- platform := runtime .GOOS
776+ platformOS := runtime .GOOS
777777 if f .constraints .Platform != nil {
778- platform = f .constraints .Platform .OS
778+ platformOS = f .constraints .Platform .OS
779779 }
780- action , err := st .action .toProtoAction (ctx , parent , st .base , platform )
780+ action , err := st .action .toProtoAction (ctx , parent , st .base , platformOS )
781781 if err != nil {
782782 return "" , nil , nil , nil , err
783783 }
0 commit comments