fix docker push tags cast

This commit is contained in:
sylviamoss 2020-09-28 11:18:24 +02:00
parent aa9c162c60
commit 49bc7665c1
1 changed files with 5 additions and 3 deletions

View File

@ -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.