From 1079b1d33398dbc4d6d2762986ff2022aa3a3e31 Mon Sep 17 00:00:00 2001 From: Orestis Floros Date: Tue, 3 Oct 2023 14:20:22 +0200 Subject: [PATCH] Azure: Fix map (#1382) `inventory` types were used twice instead of `fetching`. --- resources/fetching/fetcher.go | 10 +++++----- resources/fetching/fetchers/azure/assets_fetcher.go | 10 +++++----- resources/providers/azurelib/inventory/asset.go | 10 +++++----- 3 files changed, 15 insertions(+), 15 deletions(-) diff --git a/resources/fetching/fetcher.go b/resources/fetching/fetcher.go index 5f4afce264..ed6d299344 100644 --- a/resources/fetching/fetcher.go +++ b/resources/fetching/fetcher.go @@ -72,14 +72,14 @@ const ( ProjectManagement = "project-management" DataProcessing = "data-processing" + AzureActivityLogAlertType = "azure-activity-log-alert" + AzureClassicStorageAccountType = "azure-classic-storage-account" + AzureClassicVMType = "azure-classic-vm" AzureDiskType = "azure-disk" + AzureMySQLDBType = "azure-mysql-server-db" + AzurePostgreSQLDBType = "azure-postgresql-server-db" AzureStorageAccountType = "azure-storage-account" AzureVMType = "azure-vm" - AzurePostgreSQLDBType = "azure-postgresql-server-db" - AzureMySQLDBType = "azure-mysql-server-db" - AzureClassicVMType = "azure-classic-vm" - AzureClassicStorageAccountType = "azure-classic-storage-account" - AzureActivityLogAlertType = "azure-activity-log-alert" AzureWebSiteType = "azure-web-site" ) diff --git a/resources/fetching/fetchers/azure/assets_fetcher.go b/resources/fetching/fetchers/azure/assets_fetcher.go index 6334807d6c..54f8773aaf 100644 --- a/resources/fetching/fetchers/azure/assets_fetcher.go +++ b/resources/fetching/fetchers/azure/assets_fetcher.go @@ -40,15 +40,15 @@ type AzureResource struct { } var AzureResourceTypes = map[string]string{ + inventory.ActivityLogAlertAssetType: fetching.AzureActivityLogAlertType, + inventory.ClassicStorageAccountAssetType: fetching.AzureClassicStorageAccountType, + inventory.ClassicVirtualMachineAssetType: fetching.AzureClassicVMType, inventory.DiskAssetType: fetching.AzureDiskType, + inventory.MySQLDBAssetType: fetching.AzureMySQLDBType, + inventory.PostgreSQLDBAssetType: fetching.AzurePostgreSQLDBType, inventory.StorageAccountAssetType: fetching.AzureStorageAccountType, inventory.VirtualMachineAssetType: fetching.AzureVMType, - inventory.ClassicStorageAccountAssetType: inventory.ClassicStorageAccountAssetType, - inventory.ClassicVirtualMachineAssetType: inventory.ClassicVirtualMachineAssetType, - inventory.ActivityLogAlertAssetType: fetching.AzureActivityLogAlertType, inventory.WebsitesAssetType: fetching.AzureWebSiteType, - inventory.PostgreSQLDBAssetType: fetching.AzurePostgreSQLDBType, - inventory.MySQLDBAssetType: fetching.AzureMySQLDBType, } func NewAzureAssetsFetcher(log *logp.Logger, ch chan fetching.ResourceInfo, provider inventory.ServiceAPI) *AzureAssetsFetcher { diff --git a/resources/providers/azurelib/inventory/asset.go b/resources/providers/azurelib/inventory/asset.go index 3c1fdd615f..1a8d4d8cb1 100644 --- a/resources/providers/azurelib/inventory/asset.go +++ b/resources/providers/azurelib/inventory/asset.go @@ -18,13 +18,13 @@ package inventory const ( + ActivityLogAlertAssetType = "microsoft.insights/activitylogalerts" + ClassicStorageAccountAssetType = "microsoft.classicstorage/storageaccounts" + ClassicVirtualMachineAssetType = "microsoft.classiccompute/virtualmachines" DiskAssetType = "microsoft.compute/disks" + MySQLDBAssetType = "microsoft.dbformysql/servers" + PostgreSQLDBAssetType = "microsoft.dbforpostgresql/servers" StorageAccountAssetType = "microsoft.storage/storageaccounts" VirtualMachineAssetType = "microsoft.compute/virtualmachines" - ClassicVirtualMachineAssetType = "microsoft.classiccompute/virtualmachines" - ClassicStorageAccountAssetType = "microsoft.classicstorage/storageaccounts" - ActivityLogAlertAssetType = "microsoft.insights/activitylogalerts" WebsitesAssetType = "microsoft.web/sites" - PostgreSQLDBAssetType = "microsoft.dbforpostgresql/servers" - MySQLDBAssetType = "microsoft.dbformysql/servers" )