@@ -56,7 +56,7 @@ type CopyInput interface {
56
56
}
57
57
58
58
type 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 )
60
60
}
61
61
62
62
type capAdder interface {
@@ -162,8 +162,8 @@ type fileActionMkdir struct {
162
162
info MkdirInfo
163
163
}
164
164
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 )
167
167
if err != nil {
168
168
return nil , errors .Wrap (err , "normalizing path" )
169
169
}
@@ -340,8 +340,8 @@ type fileActionMkfile struct {
340
340
info MkfileInfo
341
341
}
342
342
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 )
345
345
if err != nil {
346
346
return nil , errors .Wrap (err , "normalizing path" )
347
347
}
@@ -412,8 +412,8 @@ type fileActionRm struct {
412
412
info RmInfo
413
413
}
414
414
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 )
417
417
if err != nil {
418
418
return nil , errors .Wrap (err , "normalizing path" )
419
419
}
@@ -506,12 +506,12 @@ type fileActionCopy struct {
506
506
info CopyInfo
507
507
}
508
508
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 )
511
511
if err != nil {
512
512
return nil , err
513
513
}
514
- normalizedPath , err := system .NormalizePath (parent , a .dest , platform , false )
514
+ normalizedPath , err := system .NormalizePath (parent , a .dest , platformOS , false )
515
515
if err != nil {
516
516
return nil , errors .Wrap (err , "normalizing path" )
517
517
}
@@ -773,11 +773,11 @@ func (f *FileOp) Marshal(ctx context.Context, c *Constraints) (digest.Digest, []
773
773
}
774
774
775
775
// Assume that we're building an image for the same OS we're running on.
776
- platform := runtime .GOOS
776
+ platformOS := runtime .GOOS
777
777
if f .constraints .Platform != nil {
778
- platform = f .constraints .Platform .OS
778
+ platformOS = f .constraints .Platform .OS
779
779
}
780
- action , err := st .action .toProtoAction (ctx , parent , st .base , platform )
780
+ action , err := st .action .toProtoAction (ctx , parent , st .base , platformOS )
781
781
if err != nil {
782
782
return "" , nil , nil , nil , err
783
783
}
0 commit comments