Skip to content

Commit

Permalink
Azure: Fix map (#1382)
Browse files Browse the repository at this point in the history
`inventory` types were used twice instead of `fetching`.
  • Loading branch information
orestisfl authored Oct 3, 2023
1 parent 6678eb4 commit 1079b1d
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 15 deletions.
10 changes: 5 additions & 5 deletions resources/fetching/fetcher.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"
)

Expand Down
10 changes: 5 additions & 5 deletions resources/fetching/fetchers/azure/assets_fetcher.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
10 changes: 5 additions & 5 deletions resources/providers/azurelib/inventory/asset.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"
)

0 comments on commit 1079b1d

Please sign in to comment.