mirror of
https://github.com/hashicorp/packer.git
synced 2026-10-04 13:43:17 -04:00
post-processor/docker-import: verify proper builder ID
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user