From 49bc7665c119e784bb73d637639ee6ec1c7e8924 Mon Sep 17 00:00:00 2001 From: sylviamoss Date: Mon, 28 Sep 2020 11:18:24 +0200 Subject: [PATCH] fix docker push tags cast --- post-processor/docker-push/post-processor.go | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/post-processor/docker-push/post-processor.go b/post-processor/docker-push/post-processor.go index 5c12e85f3..831ba1a7c 100644 --- a/post-processor/docker-push/post-processor.go +++ b/post-processor/docker-push/post-processor.go @@ -104,9 +104,11 @@ func (p *PostProcessor) PostProcess(ctx context.Context, ui packer.Ui, artifact } names := []string{artifact.Id()} - tags, _ := artifact.State("docker_tags").([]string) - if len(tags) > 0 { - names = append(names, tags...) + tags, _ := artifact.State("docker_tags").([]interface{}) + for _, tag := range tags { + if name, ok := tag.(string); ok { + names = append(names, name) + } } // Get the name.