From d49ba12e4e40e6ae614d513cc103b4a8d1e472ff Mon Sep 17 00:00:00 2001 From: Louis TOUSSAINT Date: Fri, 9 Jul 2021 15:55:33 +0200 Subject: [PATCH 1/4] Issue 823: route53 record enumerator must use SupportedType() --- pkg/remote/aws/route53_record_enumerator.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkg/remote/aws/route53_record_enumerator.go b/pkg/remote/aws/route53_record_enumerator.go index 9f861065..817f9c94 100644 --- a/pkg/remote/aws/route53_record_enumerator.go +++ b/pkg/remote/aws/route53_record_enumerator.go @@ -31,7 +31,7 @@ func (e *Route53RecordEnumerator) Enumerate() ([]resource.Resource, error) { zones, err := e.client.ListAllZones() if err != nil { - return nil, remoteerror.NewResourceEnumerationErrorWithType(err, resourceaws.AwsRoute53RecordResourceType, resourceaws.AwsRoute53ZoneResourceType) + return nil, remoteerror.NewResourceEnumerationErrorWithType(err, string(e.SupportedType()), resourceaws.AwsRoute53ZoneResourceType) } results := make([]resource.Resource, len(zones)) @@ -39,7 +39,7 @@ func (e *Route53RecordEnumerator) Enumerate() ([]resource.Resource, error) { for _, hostedZone := range zones { records, err := e.listRecordsForZone(strings.TrimPrefix(*hostedZone.Id, "/hostedzone/")) if err != nil { - return nil, remoteerror.NewResourceEnumerationError(err, resourceaws.AwsRoute53RecordResourceType) + return nil, remoteerror.NewResourceEnumerationError(err, string(e.SupportedType())) } results = append(results, records...) From 46939773b9556a7bd212315517b4e28bd734832d Mon Sep 17 00:00:00 2001 From: Louis TOUSSAINT Date: Fri, 9 Jul 2021 15:55:44 +0200 Subject: [PATCH 2/4] Issue 823: route53 zone enumerator must use SupportedType() --- pkg/remote/aws/route53_zone_enumerator.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkg/remote/aws/route53_zone_enumerator.go b/pkg/remote/aws/route53_zone_enumerator.go index 94ce3f89..534d0e65 100644 --- a/pkg/remote/aws/route53_zone_enumerator.go +++ b/pkg/remote/aws/route53_zone_enumerator.go @@ -30,7 +30,7 @@ func (e *Route53ZoneSupplier) SupportedType() resource.ResourceType { func (e *Route53ZoneSupplier) Enumerate() ([]resource.Resource, error) { zones, err := e.client.ListAllZones() if err != nil { - return nil, remoteerror.NewResourceEnumerationError(err, resourceaws.AwsRoute53ZoneResourceType) + return nil, remoteerror.NewResourceEnumerationError(err, string(e.SupportedType())) } results := make([]resource.Resource, len(zones)) From c349061c8e4c6f57f60b554176e4142f09974db8 Mon Sep 17 00:00:00 2001 From: Louis TOUSSAINT Date: Fri, 9 Jul 2021 15:55:58 +0200 Subject: [PATCH 3/4] Issue 823: vpc default security group enumerator must use SupportedType() --- pkg/remote/aws/vpc_default_security_group_enumerator.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkg/remote/aws/vpc_default_security_group_enumerator.go b/pkg/remote/aws/vpc_default_security_group_enumerator.go index a8d885de..86f39d1e 100644 --- a/pkg/remote/aws/vpc_default_security_group_enumerator.go +++ b/pkg/remote/aws/vpc_default_security_group_enumerator.go @@ -29,7 +29,7 @@ func (e *VPCDefaultSecurityGroupEnumerator) SupportedType() resource.ResourceTyp func (e *VPCDefaultSecurityGroupEnumerator) Enumerate() ([]resource.Resource, error) { _, defaultSecurityGroups, err := e.repository.ListAllSecurityGroups() if err != nil { - return nil, remoteerror.NewResourceEnumerationError(err, resourceaws.AwsSecurityGroupResourceType) + return nil, remoteerror.NewResourceEnumerationError(err, string(e.SupportedType())) } results := make([]resource.Resource, 0, len(defaultSecurityGroups)) From afe3fc318644631243916f87bbc985249fa8efb0 Mon Sep 17 00:00:00 2001 From: Louis TOUSSAINT Date: Fri, 9 Jul 2021 15:56:10 +0200 Subject: [PATCH 4/4] Issue 823: vpc security group enumerator must use SupportedType() --- pkg/remote/aws/vpc_security_group_enumerator.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkg/remote/aws/vpc_security_group_enumerator.go b/pkg/remote/aws/vpc_security_group_enumerator.go index 639606f5..df880400 100644 --- a/pkg/remote/aws/vpc_security_group_enumerator.go +++ b/pkg/remote/aws/vpc_security_group_enumerator.go @@ -29,7 +29,7 @@ func (e *VPCSecurityGroupEnumerator) SupportedType() resource.ResourceType { func (e *VPCSecurityGroupEnumerator) Enumerate() ([]resource.Resource, error) { securityGroups, _, err := e.repository.ListAllSecurityGroups() if err != nil { - return nil, remoteerror.NewResourceEnumerationError(err, resourceaws.AwsSecurityGroupResourceType) + return nil, remoteerror.NewResourceEnumerationError(err, string(e.SupportedType())) } results := make([]resource.Resource, 0, len(securityGroups))