Просмотр исходного кода

Remove unused Builder.Cancel()

Signed-off-by: Daniel Nephin <dnephin@docker.com>
Daniel Nephin 8 лет назад
Родитель
Сommit
068f344e03
1 измененных файлов с 1 добавлено и 9 удалено
  1. 1 9
      builder/dockerfile/builder.go

+ 1 - 9
builder/dockerfile/builder.go

@@ -50,7 +50,6 @@ type Builder struct {
 	docker    builder.Backend
 	context   builder.Context
 	clientCtx context.Context
-	cancel    context.CancelFunc
 
 	runConfig     *container.Config // runconfig for cmd, run, entrypoint etc.
 	flags         *BFlags
@@ -113,10 +112,8 @@ func NewBuilder(clientCtx context.Context, config *types.ImageBuildOptions, back
 	if config == nil {
 		config = new(types.ImageBuildOptions)
 	}
-	ctx, cancel := context.WithCancel(clientCtx)
 	b = &Builder{
-		clientCtx:     ctx,
-		cancel:        cancel,
+		clientCtx:     clientCtx,
 		options:       config,
 		Stdout:        os.Stdout,
 		Stderr:        os.Stderr,
@@ -313,11 +310,6 @@ func (b *Builder) hasFromImage() bool {
 	return b.image != "" || b.noBaseImage
 }
 
-// Cancel cancels an ongoing Dockerfile build.
-func (b *Builder) Cancel() {
-	b.cancel()
-}
-
 // BuildFromConfig builds directly from `changes`, treating it as if it were the contents of a Dockerfile
 // It will:
 // - Call parse.Parse() to get an AST root for the concatenated Dockerfile entries.