Merge branch 'main' into feat/add_google_compute_health_check

main
Raphaël 2021-10-28 16:18:37 +02:00 committed by GitHub
commit a2491a07ac
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 9 additions and 9 deletions

View File

@ -46,7 +46,7 @@ func (e *GoogleComputeInstanceGroupEnumerator) Enumerate() ([]*resource.Resource
string(e.SupportedType()),
trimResourceName(res.GetName()),
map[string]interface{}{
"display_name": res.GetDisplayName(),
"name": res.GetDisplayName(),
"project": project,
"location": res.GetLocation(),
},

View File

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

View File

@ -10,14 +10,14 @@ func initGoogleComputeInstanceGroupMetadata(resourceSchemaRepository resource.Sc
})
resourceSchemaRepository.SetResolveReadAttributesFunc(GoogleComputeInstanceGroupResourceType, func(res *resource.Resource) map[string]string {
return map[string]string{
"name": *res.Attributes().GetString("display_name"),
"name": *res.Attributes().GetString("name"),
"project": *res.Attributes().GetString("project"),
"zone": *res.Attributes().GetString("location"),
}
})
resourceSchemaRepository.SetHumanReadableAttributesFunc(GoogleComputeInstanceGroupResourceType, func(res *resource.Resource) map[string]string {
attrs := make(map[string]string)
if v := res.Attributes().GetString("display_name"); v != nil && *v != "" {
if v := res.Attributes().GetString("name"); v != nil && *v != "" {
attrs["Name"] = *v
}
return attrs

View File

@ -7,7 +7,7 @@ const GoogleComputeSubnetworkResourceType = "google_compute_subnetwork"
func initGoogleComputeSubnetworkMetadata(resourceSchemaRepository resource.SchemaRepositoryInterface) {
resourceSchemaRepository.SetResolveReadAttributesFunc(GoogleComputeSubnetworkResourceType, func(res *resource.Resource) map[string]string {
return map[string]string{
"name": *res.Attributes().GetString("display_name"),
"name": *res.Attributes().GetString("name"),
"region": *res.Attributes().GetString("location"),
}
})
@ -18,7 +18,7 @@ func initGoogleComputeSubnetworkMetadata(resourceSchemaRepository resource.Schem
resourceSchemaRepository.SetHumanReadableAttributesFunc(GoogleComputeSubnetworkResourceType, func(res *resource.Resource) map[string]string {
attrs := make(map[string]string)
if v := res.Attributes().GetString("display_name"); v != nil && *v != "" {
if v := res.Attributes().GetString("name"); v != nil && *v != "" {
attrs["Name"] = *v
}
return attrs