diff --git a/hcl2template/addrs/plugin.go b/hcl2template/addrs/plugin.go index f26ee796e..9b6c451bd 100644 --- a/hcl2template/addrs/plugin.go +++ b/hcl2template/addrs/plugin.go @@ -40,7 +40,7 @@ func (p *Plugin) ForDisplay() string { if p.Hostname != DefaultHashicorpPluginHost { parts = append(parts, p.Hostname) } - if p.Namespace != DefaultHashicorpPluginNamespace { + if p.Namespace != DefaultHashicorpPluginNamespace && len(parts) == 0 { parts = append(parts, p.Namespace) } parts = append(parts, p.Type) diff --git a/hcl2template/types.packer_config_test.go b/hcl2template/types.packer_config_test.go index a9a0488e6..e4b526068 100644 --- a/hcl2template/types.packer_config_test.go +++ b/hcl2template/types.packer_config_test.go @@ -650,7 +650,7 @@ func TestParser_no_init(t *testing.T) { []packersdk.Build{}, false, }, - {"invalid_short_source_2.pkr.hcl", + {"invalid_inexplicit_source_2.pkr.hcl", defaultParser, parseTestArgs{"testdata/init/invalid_inexplicit_source_2.pkr.hcl", nil, nil}, &PackerConfig{