Merge pull request #46754 from Frankkkkk/master
builder/dockerfile: errmsg: quote build target
This commit is contained in:
commit
217054ddea
2 changed files with 2 additions and 2 deletions
|
@ -199,7 +199,7 @@ func (b *Builder) build(ctx context.Context, source builder.Source, dockerfile *
|
|||
targetIx, found := instructions.HasStage(stages, b.options.Target)
|
||||
if !found {
|
||||
buildsFailed.WithValues(metricsBuildTargetNotReachableError).Inc()
|
||||
return nil, errdefs.InvalidParameter(errors.Errorf("failed to reach build target %s in Dockerfile", b.options.Target))
|
||||
return nil, errdefs.InvalidParameter(errors.Errorf("target stage %q could not be found", b.options.Target))
|
||||
}
|
||||
stages = stages[:targetIx+1]
|
||||
}
|
||||
|
|
|
@ -5946,7 +5946,7 @@ func (s *DockerCLIBuildSuite) TestBuildIntermediateTarget(c *testing.T) {
|
|||
cli.WithFlags("--target", "nosuchtarget"))
|
||||
result.Assert(c, icmd.Expected{
|
||||
ExitCode: 1,
|
||||
Err: "failed to reach build target",
|
||||
Err: "target stage \"nosuchtarget\" could not be found",
|
||||
})
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue