diff --git a/post-processor/docker-push/post-processor.go b/post-processor/docker-push/post-processor.go index d56f91382..ca8e1a84e 100644 --- a/post-processor/docker-push/post-processor.go +++ b/post-processor/docker-push/post-processor.go @@ -2,7 +2,6 @@ package dockerpush import ( "fmt" - "strings" "github.com/mitchellh/packer/builder/docker" "github.com/mitchellh/packer/common" @@ -81,18 +80,9 @@ func (p *PostProcessor) PostProcess(ui packer.Ui, artifact packer.Artifact) (pac }() } - // Get the name. We strip off any tags from the name because the - // push doesn't use those. + // Get the name. name := artifact.Id() - if i := strings.Index(name, "/"); i >= 0 { - // This should always be true because the / is required. But we have - // to get the index to this so we don't accidentally strip off the port - if j := strings.Index(name[i:], ":"); j >= 0 { - name = name[:i+j] - } - } - ui.Message("Pushing: " + name) if err := driver.Push(name); err != nil { return nil, false, err diff --git a/post-processor/docker-push/post-processor_test.go b/post-processor/docker-push/post-processor_test.go index eba7b174f..c78e2b136 100644 --- a/post-processor/docker-push/post-processor_test.go +++ b/post-processor/docker-push/post-processor_test.go @@ -108,7 +108,7 @@ func TestPostProcessor_PostProcess_tags(t *testing.T) { if !driver.PushCalled { t.Fatal("should call push") } - if driver.PushName != "hashicorp/ubuntu" { + if driver.PushName != "hashicorp/ubuntu:precise" { t.Fatalf("bad name: %s", driver.PushName) } }