fix: use name instead of display_name
parent
9ae26aba17
commit
e5b55aad94
|
@ -46,9 +46,9 @@ func (e *GoogleComputeInstanceGroupEnumerator) Enumerate() ([]*resource.Resource
|
||||||
string(e.SupportedType()),
|
string(e.SupportedType()),
|
||||||
trimResourceName(res.GetName()),
|
trimResourceName(res.GetName()),
|
||||||
map[string]interface{}{
|
map[string]interface{}{
|
||||||
"display_name": res.GetDisplayName(),
|
"name": res.GetDisplayName(),
|
||||||
"project": project,
|
"project": project,
|
||||||
"location": res.GetLocation(),
|
"location": res.GetLocation(),
|
||||||
},
|
},
|
||||||
),
|
),
|
||||||
)
|
)
|
||||||
|
|
|
@ -38,8 +38,8 @@ func (e *GoogleComputeSubnetworkEnumerator) Enumerate() ([]*resource.Resource, e
|
||||||
string(e.SupportedType()),
|
string(e.SupportedType()),
|
||||||
trimResourceName(res.GetName()),
|
trimResourceName(res.GetName()),
|
||||||
map[string]interface{}{
|
map[string]interface{}{
|
||||||
"display_name": res.GetDisplayName(),
|
"name": res.GetDisplayName(),
|
||||||
"location": res.GetLocation(),
|
"location": res.GetLocation(),
|
||||||
},
|
},
|
||||||
),
|
),
|
||||||
)
|
)
|
||||||
|
|
|
@ -10,14 +10,14 @@ func initGoogleComputeInstanceGroupMetadata(resourceSchemaRepository resource.Sc
|
||||||
})
|
})
|
||||||
resourceSchemaRepository.SetResolveReadAttributesFunc(GoogleComputeInstanceGroupResourceType, func(res *resource.Resource) map[string]string {
|
resourceSchemaRepository.SetResolveReadAttributesFunc(GoogleComputeInstanceGroupResourceType, func(res *resource.Resource) map[string]string {
|
||||||
return map[string]string{
|
return map[string]string{
|
||||||
"name": *res.Attributes().GetString("display_name"),
|
"name": *res.Attributes().GetString("name"),
|
||||||
"project": *res.Attributes().GetString("project"),
|
"project": *res.Attributes().GetString("project"),
|
||||||
"zone": *res.Attributes().GetString("location"),
|
"zone": *res.Attributes().GetString("location"),
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
resourceSchemaRepository.SetHumanReadableAttributesFunc(GoogleComputeInstanceGroupResourceType, func(res *resource.Resource) map[string]string {
|
resourceSchemaRepository.SetHumanReadableAttributesFunc(GoogleComputeInstanceGroupResourceType, func(res *resource.Resource) map[string]string {
|
||||||
attrs := make(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
|
attrs["Name"] = *v
|
||||||
}
|
}
|
||||||
return attrs
|
return attrs
|
||||||
|
|
|
@ -7,7 +7,7 @@ const GoogleComputeSubnetworkResourceType = "google_compute_subnetwork"
|
||||||
func initGoogleComputeSubnetworkMetadata(resourceSchemaRepository resource.SchemaRepositoryInterface) {
|
func initGoogleComputeSubnetworkMetadata(resourceSchemaRepository resource.SchemaRepositoryInterface) {
|
||||||
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("display_name"),
|
"name": *res.Attributes().GetString("name"),
|
||||||
"region": *res.Attributes().GetString("location"),
|
"region": *res.Attributes().GetString("location"),
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
@ -18,7 +18,7 @@ func initGoogleComputeSubnetworkMetadata(resourceSchemaRepository resource.Schem
|
||||||
resourceSchemaRepository.SetHumanReadableAttributesFunc(GoogleComputeSubnetworkResourceType, func(res *resource.Resource) map[string]string {
|
resourceSchemaRepository.SetHumanReadableAttributesFunc(GoogleComputeSubnetworkResourceType, func(res *resource.Resource) map[string]string {
|
||||||
attrs := make(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
|
attrs["Name"] = *v
|
||||||
}
|
}
|
||||||
return attrs
|
return attrs
|
||||||
|
|
Loading…
Reference in New Issue