Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Changing parent to resourceGroup to remove duplicate network gateway entry. Closes #180 #181

Merged
merged 1 commit into from
Jul 15, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions azure/table_azure_virtual_network_gateway.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import (
"context"
"strings"

"github.com/Azure/azure-sdk-for-go/profiles/latest/resources/mgmt/resources"
"github.com/Azure/azure-sdk-for-go/services/network/mgmt/2020-05-01/network"
"github.com/turbot/steampipe-plugin-sdk/grpc/proto"
"github.com/turbot/steampipe-plugin-sdk/plugin"
Expand All @@ -22,7 +23,7 @@ func tableAzureVirtualNetworkGateway(_ context.Context) *plugin.Table {
ShouldIgnoreError: isNotFoundError([]string{"ResourceGroupNotFound", "ResourceNotFound", "404"}),
},
List: &plugin.ListConfig{
ParentHydrate: listVirtualNetworks,
ParentHydrate: listResourceGroups,
Hydrate: listVirtualNetworkGateways,
},
Columns: []*plugin.Column{
Expand Down Expand Up @@ -217,8 +218,8 @@ func listVirtualNetworkGateways(ctx context.Context, d *plugin.QueryData, h *plu
networkClient := network.NewVirtualNetworkGatewaysClient(subscriptionID)
networkClient.Authorizer = session.Authorizer

virtualNetwork := h.Item.(network.VirtualNetwork)
resourceGroupName := strings.Split(*virtualNetwork.ID, "/")[4]
data := h.Item.(resources.Group)
resourceGroupName := *data.Name

pagesLeft := true
for pagesLeft {
Expand Down