From f17b055476c547586ec1c33b4f0a48050a54d2db Mon Sep 17 00:00:00 2001 From: Louis Ruch Date: Wed, 27 May 2026 11:59:35 -0700 Subject: [PATCH] copilot review --- plugin/service/host/plugin.go | 2 +- testing/e2e_host_test.go | 9 +++++---- testing/testdata/host/vpc_ec2.tf | 3 +-- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/plugin/service/host/plugin.go b/plugin/service/host/plugin.go index 4b95775..17b1836 100644 --- a/plugin/service/host/plugin.go +++ b/plugin/service/host/plugin.go @@ -669,7 +669,7 @@ func awsInstanceToHost(instance types.Instance, catalogAttributes *CatalogAttrib } } - // First lets get the instance Private IPv4/DNS, Public IPv4/DNS, and IPv6 address + // First let's get the instance's Private IPv4/DNS, Public IPv4/DNS, and IPv6 addresses result.IpAddresses = appendDistinct(result.IpAddresses, instance.PrivateIpAddress, instance.PublicIpAddress, instance.Ipv6Address) result.DnsNames = appendDistinct(result.DnsNames, instance.PrivateDnsName, instance.PublicDnsName) diff --git a/testing/e2e_host_test.go b/testing/e2e_host_test.go index 16f4d33..2856a63 100644 --- a/testing/e2e_host_test.go +++ b/testing/e2e_host_test.go @@ -166,7 +166,7 @@ func TestHostPlugin(t *testing.T) { // TODO: add OnDeleteSet if it needs to be implemented } - // finally lets test instance_address_only catalog attribute correctly syncs only instance addresses + // finally lets test instance_addresses_only catalog attribute correctly syncs only instance addresses testInstanceAddressesOnlyListHosts(ctx, t, p, tf, region, keyid, secret) } @@ -466,12 +466,13 @@ func testInstanceAddressesOnlyListHosts(ctx context.Context, t *testing.T, p *ho secondaryAddresses, err := tf.GetOutputMap("multi_address_secondary_addresses") require.NoError(t, err) - var primary, secondary []string + var primary, allAddresses []string for _, addr := range primaryAddresses { primary = append(primary, addr.(string)) } + allAddresses = append(allAddresses, primary...) for _, addr := range secondaryAddresses { - secondary = append(secondary, addr.(string)) + allAddresses = append(allAddresses, addr.(string)) } cases := []struct { @@ -481,7 +482,7 @@ func testInstanceAddressesOnlyListHosts(ctx context.Context, t *testing.T, p *ho }{ { name: "all addresses", - expectedIPs: append(primary, secondary...), + expectedIPs: allAddresses, }, { name: "instance addresses only", diff --git a/testing/testdata/host/vpc_ec2.tf b/testing/testdata/host/vpc_ec2.tf index f2a5fe2..1686cc9 100644 --- a/testing/testdata/host/vpc_ec2.tf +++ b/testing/testdata/host/vpc_ec2.tf @@ -33,7 +33,7 @@ resource "aws_subnet" "subnet" { assign_ipv6_address_on_creation = true } -# Need to add a gateway for public IP addr assignments +# Need to add a gateway for public IP addr assignments resource "aws_internet_gateway" "igw" { vpc_id = aws_vpc.vpc.id } @@ -178,4 +178,3 @@ output "multi_address_secondary_addresses" { secondary_eni_ipv6 = tolist(aws_network_interface.multi_address_secondary_eni.ipv6_addresses)[0] } } -