Merge pull request #1526 from askholme/fix-docker-push

make docker-push work with docker-tag artifacts
This commit is contained in:
Mitchell Hashimoto 2014-10-14 16:03:52 -07:00
commit 333506f54c
1 changed files with 3 additions and 2 deletions

View File

@ -6,6 +6,7 @@ import (
"github.com/mitchellh/packer/common" "github.com/mitchellh/packer/common"
"github.com/mitchellh/packer/packer" "github.com/mitchellh/packer/packer"
"github.com/mitchellh/packer/post-processor/docker-import" "github.com/mitchellh/packer/post-processor/docker-import"
"github.com/mitchellh/packer/post-processor/docker-tag"
"strings" "strings"
) )
@ -67,9 +68,9 @@ 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() != dockerimport.BuilderId { if artifact.BuilderId() != dockerimport.BuilderId && artifact.BuilderId() != dockertag.BuilderId {
err := fmt.Errorf( err := fmt.Errorf(
"Unknown artifact type: %s\nCan only import from docker-import artifacts.", "Unknown artifact type: %s\nCan only import from docker-import and docker-tag artifacts.",
artifact.BuilderId()) artifact.BuilderId())
return nil, false, err return nil, false, err
} }