Skip to content

Commit b29ec0b

Browse files
Remove nil pointer check and extra NormalizePath
Signed-off-by: Gabriel Adrian Samfira <[email protected]>
1 parent 7a503ae commit b29ec0b

File tree

2 files changed

+2
-10
lines changed

2 files changed

+2
-10
lines changed

frontend/dockerfile/dockerfile2llb/convert.go

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -995,11 +995,7 @@ func dispatchRun(d *dispatchState, c *instructions.RunCommand, proxy *llb.ProxyE
995995
}
996996

997997
func dispatchWorkdir(d *dispatchState, c *instructions.WorkdirCommand, commit bool, opt *dispatchOpt) error {
998-
platformOS := runtime.GOOS
999-
if d.platform != nil {
1000-
platformOS = d.platform.OS
1001-
}
1002-
wd, err := system.NormalizeWorkdir(d.image.Config.WorkingDir, c.Path, platformOS)
998+
wd, err := system.NormalizeWorkdir(d.image.Config.WorkingDir, c.Path, d.platform.OS)
1003999
if err != nil {
10041000
return errors.Wrap(err, "normalizing workdir")
10051001
}

solver/llbsolver/file/backend.go

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -68,11 +68,7 @@ func mapUserToChowner(user *copy.User, idmap *idtools.IdentityMapping) (copy.Cho
6868
}
6969

7070
func mkdir(ctx context.Context, d string, action pb.FileActionMkDir, user *copy.User, idmap *idtools.IdentityMapping) error {
71-
actionPath, err := system.NormalizePath("/", action.Path, runtime.GOOS, false)
72-
if err != nil {
73-
return errors.Wrap(err, "removing drive letter")
74-
}
75-
p, err := fs.RootPath(d, filepath.FromSlash(actionPath))
71+
p, err := fs.RootPath(d, action.Path)
7672
if err != nil {
7773
return err
7874
}

0 commit comments

Comments
 (0)