Merge pull request #1288 from TomChv/fix/fs-naming

This commit is contained in:
Andrea Luzzardi
2021-12-23 15:03:39 +01:00
committed by GitHub
8 changed files with 30 additions and 34 deletions

View File

@@ -24,8 +24,8 @@ func (t *mkdirTask) Run(ctx context.Context, pctx *plancontext.Context, s solver
return nil, err
}
// Mode (int)
mode, err := v.Lookup("mode").Int64()
// Permissions (int)
permissions, err := v.Lookup("permissions").Int64()
if err != nil {
return nil, err
}
@@ -58,7 +58,7 @@ func (t *mkdirTask) Run(ctx context.Context, pctx *plancontext.Context, s solver
// Add Mkdir operation on input llb state
outputState := inputState.File(
llb.Mkdir(path, fs.FileMode(mode), mkdirOpts...),
llb.Mkdir(path, fs.FileMode(permissions), mkdirOpts...),
withCustomName(v, "Mkdir %s", path),
)

View File

@@ -48,7 +48,7 @@ func (t *writeFileTask) Run(ctx context.Context, pctx *plancontext.Context, s so
return nil, err
}
mode, err := v.Lookup("mode").Int64()
permissions, err := v.Lookup("permissions").Int64()
if err != nil {
return nil, err
@@ -67,7 +67,7 @@ func (t *writeFileTask) Run(ctx context.Context, pctx *plancontext.Context, s so
}
outputState := inputState.File(
llb.Mkfile(path, fs.FileMode(mode), contents),
llb.Mkfile(path, fs.FileMode(permissions), contents),
withCustomName(v, "WriteFile %s", path),
)
@@ -77,11 +77,11 @@ func (t *writeFileTask) Run(ctx context.Context, pctx *plancontext.Context, s so
return nil, err
}
fs := pctx.FS.New(result)
outputFS := pctx.FS.New(result)
output := compiler.NewValue()
if err := output.FillPath(cue.ParsePath("output"), fs.MarshalCUE()); err != nil {
if err := output.FillPath(cue.ParsePath("output"), outputFS.MarshalCUE()); err != nil {
return nil, err
}