From e595e1d83368cfeaa6f80774d4f5b60b6acd5f4a Mon Sep 17 00:00:00 2001 From: "Frederick F. Kautz IV" Date: Sun, 11 Apr 2021 16:30:48 -0700 Subject: [PATCH] variables shouldn't shadow packages Signed-off-by: Frederick F. Kautz IV --- dagger/pipeline.go | 16 ++++++++-------- dagger/solver.go | 4 ++-- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/dagger/pipeline.go b/dagger/pipeline.go index 9dd40ca3..db824eb8 100644 --- a/dagger/pipeline.go +++ b/dagger/pipeline.go @@ -672,8 +672,8 @@ func (p *Pipeline) FetchGit(ctx context.Context, op *compiler.Value, st llb.Stat func (p *Pipeline) DockerBuild(ctx context.Context, op *compiler.Value, st llb.State) (llb.State, error) { var ( - context = op.Lookup("context") - dockerfile = op.Lookup("dockerfile") + dockerContext = op.Lookup("context") + dockerfile = op.Lookup("dockerfile") contextDef *bkpb.Definition dockerfileDef *bkpb.Definition @@ -681,15 +681,15 @@ func (p *Pipeline) DockerBuild(ctx context.Context, op *compiler.Value, st llb.S err error ) - if !context.Exists() && !dockerfile.Exists() { + if !dockerContext.Exists() && !dockerfile.Exists() { return st, errors.New("context or dockerfile required") } // docker build context. This can come from another component, so we need to // compute it first. - if context.Exists() { + if dockerContext.Exists() { from := NewPipeline(op.Lookup("context").Path().String(), p.s) - if err := from.Do(ctx, context); err != nil { + if err := from.Do(ctx, dockerContext); err != nil { return st, err } fromResult, err := from.Result() @@ -820,7 +820,7 @@ func (p *Pipeline) WriteFile(ctx context.Context, op *compiler.Value, st llb.Sta } func (p *Pipeline) Mkdir(ctx context.Context, op *compiler.Value, st llb.State) (llb.State, error) { - path, err := op.Lookup("path").String() + pathString, err := op.Lookup("path").String() if err != nil { return st, err } @@ -836,7 +836,7 @@ func (p *Pipeline) Mkdir(ctx context.Context, op *compiler.Value, st llb.State) } return st.Dir(dir).File( - llb.Mkdir(path, fs.FileMode(mode)), - llb.WithCustomName(p.vertexNamef("Mkdir %s", path)), + llb.Mkdir(pathString, fs.FileMode(mode)), + llb.WithCustomName(p.vertexNamef("Mkdir %s", pathString)), ), nil } diff --git a/dagger/solver.go b/dagger/solver.go index dcb05828..8449a94e 100644 --- a/dagger/solver.go +++ b/dagger/solver.go @@ -81,7 +81,7 @@ func (s Solver) Solve(ctx context.Context, st llb.State) (bkgw.Reference, error) return nil, err } - llb, err := dumpLLB(def) + jsonLLB, err := dumpLLB(def) if err != nil { return nil, err } @@ -89,7 +89,7 @@ func (s Solver) Solve(ctx context.Context, st llb.State) (bkgw.Reference, error) log. Ctx(ctx). Trace(). - RawJSON("llb", llb). + RawJSON("llb", jsonLLB). Msg("solving") // call solve