From 1de226c7482db98a218fb6f0c3e62ca038c2f609 Mon Sep 17 00:00:00 2001 From: Mitchell Hashimoto Date: Sun, 19 Jan 2014 19:56:50 -0800 Subject: [PATCH] post-processor/docker-import: verify proper builder ID --- post-processor/docker-import/post-processor.go | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/post-processor/docker-import/post-processor.go b/post-processor/docker-import/post-processor.go index 639e2798e..5571c5e0b 100644 --- a/post-processor/docker-import/post-processor.go +++ b/post-processor/docker-import/post-processor.go @@ -64,6 +64,13 @@ func (p *PostProcessor) Configure(raws ...interface{}) error { } func (p *PostProcessor) PostProcess(ui packer.Ui, artifact packer.Artifact) (packer.Artifact, bool, error) { + if artifact.BuilderId() != docker.BuilderId { + err := fmt.Errorf( + "Unknown artifact type: %s\nCan only import from Docker builder artifacts.", + artifact.BuilderId()) + return nil, false, err + } + importRepo := p.config.Repository if p.config.Tag != "" { importRepo += ":" + p.config.Tag