diff --git a/hcl2template/types.required_plugins.go b/hcl2template/types.required_plugins.go index a78c46837..69bd008df 100644 --- a/hcl2template/types.required_plugins.go +++ b/hcl2template/types.required_plugins.go @@ -99,7 +99,7 @@ func (cfg *PackerConfig) requirePluginImplicitly(block *hcl.Block, componentRedi } componentName := block.Labels[0] - redirect, _ := componentRedirects[componentName] + redirect := componentRedirects[componentName] if redirect == "" { // no known redirect for this component return nil diff --git a/hcl2template/types.required_plugins_test.go b/hcl2template/types.required_plugins_test.go index be17279a8..c05f03c05 100644 --- a/hcl2template/types.required_plugins_test.go +++ b/hcl2template/types.required_plugins_test.go @@ -40,7 +40,7 @@ func TestPackerConfig_required_plugin_parse(t *testing.T) { "amazon": { Name: "amazon", Source: "github.com/hashicorp/amazon", - Type: &addrs.Plugin{"github.com", "hashicorp", "amazon"}, + Type: &addrs.Plugin{Hostname: "github.com", Namespace: "hashicorp", Type: "amazon"}, Requirement: VersionConstraint{ Required: mustVersionConstraints(version.NewConstraint("~> v1.2.3")), }, @@ -74,7 +74,7 @@ func TestPackerConfig_required_plugin_parse(t *testing.T) { "amazon": { Name: "amazon", Source: "github.com/hashicorp/amazon", - Type: &addrs.Plugin{"github.com", "hashicorp", "amazon"}, + Type: &addrs.Plugin{Hostname: "github.com", Namespace: "hashicorp", Type: "amazon"}, Requirement: VersionConstraint{ Required: nil, }, @@ -109,7 +109,7 @@ func TestPackerConfig_required_plugin_parse(t *testing.T) { "ansible": { Name: "ansible", Source: "github.com/ansible/ansible", - Type: &addrs.Plugin{"github.com", "ansible", "ansible"}, + Type: &addrs.Plugin{Hostname: "github.com", Namespace: "ansible", Type: "ansible"}, Requirement: VersionConstraint{ Required: nil, }, @@ -144,7 +144,7 @@ func TestPackerConfig_required_plugin_parse(t *testing.T) { "docker": { Name: "docker", Source: "github.com/hashicorp/docker", - Type: &addrs.Plugin{"github.com", "hashicorp", "docker"}, + Type: &addrs.Plugin{Hostname: "github.com", Namespace: "hashicorp", Type: "docker"}, Requirement: VersionConstraint{ Required: nil, }, @@ -182,7 +182,7 @@ func TestPackerConfig_required_plugin_parse(t *testing.T) { "docker": { Name: "docker", Source: "github.com/hashicorp/docker", - Type: &addrs.Plugin{"github.com", "hashicorp", "docker"}, + Type: &addrs.Plugin{Hostname: "github.com", Namespace: "hashicorp", Type: "docker"}, Requirement: VersionConstraint{ Required: nil, }, @@ -225,7 +225,7 @@ func TestPackerConfig_required_plugin_parse(t *testing.T) { "amazon-v1": { Name: "amazon-v1", Source: "github.com/hashicorp/amazon", - Type: &addrs.Plugin{"github.com", "hashicorp", "amazon"}, + Type: &addrs.Plugin{Hostname: "github.com", Namespace: "hashicorp", Type: "amazon"}, Requirement: VersionConstraint{ Required: mustVersionConstraints(version.NewConstraint("~> v1.0")), }, @@ -236,7 +236,7 @@ func TestPackerConfig_required_plugin_parse(t *testing.T) { "amazon": { Name: "amazon", Source: "github.com/hashicorp/amazon", - Type: &addrs.Plugin{"github.com", "hashicorp", "amazon"}, + Type: &addrs.Plugin{Hostname: "github.com", Namespace: "hashicorp", Type: "amazon"}, Requirement: VersionConstraint{ Required: nil, },