Merge pull request #2294 from vtolstov/docker
allow import qemu builded artifacts
This commit is contained in:
commit
ec9be0928b
|
@ -4,6 +4,7 @@ import (
|
||||||
"fmt"
|
"fmt"
|
||||||
|
|
||||||
"github.com/mitchellh/packer/builder/docker"
|
"github.com/mitchellh/packer/builder/docker"
|
||||||
|
"github.com/mitchellh/packer/builder/qemu"
|
||||||
"github.com/mitchellh/packer/common"
|
"github.com/mitchellh/packer/common"
|
||||||
"github.com/mitchellh/packer/helper/config"
|
"github.com/mitchellh/packer/helper/config"
|
||||||
"github.com/mitchellh/packer/packer"
|
"github.com/mitchellh/packer/packer"
|
||||||
|
@ -42,9 +43,12 @@ func (p *PostProcessor) Configure(raws ...interface{}) error {
|
||||||
}
|
}
|
||||||
|
|
||||||
func (p *PostProcessor) PostProcess(ui packer.Ui, artifact packer.Artifact) (packer.Artifact, bool, error) {
|
func (p *PostProcessor) PostProcess(ui packer.Ui, artifact packer.Artifact) (packer.Artifact, bool, error) {
|
||||||
if artifact.BuilderId() != docker.BuilderId {
|
switch artifact.BuilderId() {
|
||||||
|
case docker.BuilderId, qemu.BuilderId:
|
||||||
|
break
|
||||||
|
default:
|
||||||
err := fmt.Errorf(
|
err := fmt.Errorf(
|
||||||
"Unknown artifact type: %s\nCan only import from Docker builder artifacts.",
|
"Unknown artifact type: %s\nCan only import from Docker, Qemu builder artifacts.",
|
||||||
artifact.BuilderId())
|
artifact.BuilderId())
|
||||||
return nil, false, err
|
return nil, false, err
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue