fix(google): compute_subnetwork

The scan panics because enumerator attributes are not sync with the resource schema.
main
sundowndev 2021-12-17 11:44:02 +04:00
parent eab3c2ce4f
commit a83ce83f5c
No known key found for this signature in database
GPG Key ID: 100CE2799D978462
2 changed files with 3 additions and 3 deletions

View File

@ -39,7 +39,7 @@ func (e *GoogleComputeSubnetworkEnumerator) Enumerate() ([]*resource.Resource, e
trimResourceName(res.GetName()), trimResourceName(res.GetName()),
map[string]interface{}{ map[string]interface{}{
"name": res.GetDisplayName(), "name": res.GetDisplayName(),
"location": res.GetLocation(), "region": res.GetLocation(),
}, },
), ),
) )

View File

@ -8,7 +8,7 @@ func initGoogleComputeSubnetworkMetadata(resourceSchemaRepository resource.Schem
resourceSchemaRepository.SetResolveReadAttributesFunc(GoogleComputeSubnetworkResourceType, func(res *resource.Resource) map[string]string { resourceSchemaRepository.SetResolveReadAttributesFunc(GoogleComputeSubnetworkResourceType, func(res *resource.Resource) map[string]string {
return map[string]string{ return map[string]string{
"name": *res.Attributes().GetString("name"), "name": *res.Attributes().GetString("name"),
"region": *res.Attributes().GetString("location"), "region": *res.Attributes().GetString("region"),
} }
}) })
resourceSchemaRepository.SetNormalizeFunc(GoogleComputeSubnetworkResourceType, func(res *resource.Resource) { resourceSchemaRepository.SetNormalizeFunc(GoogleComputeSubnetworkResourceType, func(res *resource.Resource) {