Merge pull request #830 from cloudskiff/issue_823_use_supportedtype

Use SupportedType() in enumerator
main
Toussaint Louis 2021-07-09 16:17:11 +02:00 committed by GitHub
commit 9cb7a57e28
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 5 additions and 5 deletions

View File

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

View File

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

View File

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

View File

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