Commit 5bd2d4e6 authored by James G. Kim's avatar James G. Kim

Fix a problem preventing `tag` or `save` from docker-tag artifacts

parent 793698f8
...@@ -9,6 +9,7 @@ import ( ...@@ -9,6 +9,7 @@ import (
"github.com/mitchellh/packer/helper/config" "github.com/mitchellh/packer/helper/config"
"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"
"github.com/mitchellh/packer/template/interpolate" "github.com/mitchellh/packer/template/interpolate"
) )
...@@ -44,7 +45,8 @@ func (p *PostProcessor) Configure(raws ...interface{}) error { ...@@ -44,7 +45,8 @@ 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 save Docker builder artifacts.", "Unknown artifact type: %s\nCan only save Docker builder artifacts.",
artifact.BuilderId()) artifact.BuilderId())
......
...@@ -45,7 +45,8 @@ func (p *PostProcessor) Configure(raws ...interface{}) error { ...@@ -45,7 +45,8 @@ 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() != BuilderId &&
artifact.BuilderId() != dockerimport.BuilderId {
err := fmt.Errorf( err := fmt.Errorf(
"Unknown artifact type: %s\nCan only tag from Docker builder artifacts.", "Unknown artifact type: %s\nCan only tag from Docker builder artifacts.",
artifact.BuilderId()) artifact.BuilderId())
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment