feat(plugin): Support extracting Azure resource name (#11)

This commit is contained in:
Hugo authored and GitHub committed 2023-04-17 11:00:31 +01:00
1 parent 68efe80605
commit e91c135142
3 files changed
+79 -96

No files matched your search

+9 -3
View File
@@ -389,10 +389,16 @@ func (p *AzurePlugin) ListHosts(ctx context.Context, req *pb.ListHostsRequest) (
ret := &pb.ListHostsResponse{}
for k, v := range vmToNetworkMap {
_, externalName, err := splitId(k, constMsComputeService, constVirtualMachinesResource)
if err != nil {
externalName = ""
}
host := &pb.ListHostsResponseHost{
ExternalId: k,
IpAddresses: v.IpAddresses,
SetIds: resourceToSetMap[k],
ExternalId: k,
ExternalName: externalName,
IpAddresses: v.IpAddresses,
SetIds: resourceToSetMap[k],
}
ret.Hosts = append(ret.Hosts, host)
}