Skip to content

Commit

Permalink
🧹 Rename region label to location label for azure vms. (#3013)
Browse files Browse the repository at this point in the history
Signed-off-by: Preslav <[email protected]>
  • Loading branch information
preslavgerchev authored Jan 12, 2024
1 parent 3a1ceb4 commit ae6208a
Showing 1 changed file with 13 additions and 13 deletions.
26 changes: 13 additions & 13 deletions providers/azure/resources/discovery.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ import (

const (
SubscriptionLabel = "azure.mondoo.com/subscription"
RegionLabel = "mondoo.com/region"
LocationLabel = "mondoo.com/location"
InstanceLabel = "mondoo.com/instance"

DiscoveryAuto = "auto"
Expand All @@ -41,7 +41,7 @@ const (
type azureObject struct {
subscription string
id string
region string
location string
service string
objectType string
}
Expand Down Expand Up @@ -201,7 +201,7 @@ func discoverInstancesApi(runtime *plugin.Runtime, subsWithConfigs []subWithConf
azureObject: azureObject{
id: vm.Id.Data,
subscription: *subWithConfig.sub.SubscriptionID,
region: vm.Location.Data,
location: vm.Location.Data,
service: "compute",
objectType: "vm-api",
},
Expand Down Expand Up @@ -248,7 +248,7 @@ func discoverInstances(runtime *plugin.Runtime, subsWithConfigs []subWithConfig)
azureObject: azureObject{
id: vm.Id.Data,
subscription: *subWithConfig.sub.SubscriptionID,
region: vm.Location.Data,
location: vm.Location.Data,
service: "compute",
objectType: "vm",
},
Expand Down Expand Up @@ -299,7 +299,7 @@ func discoverSqlServers(runtime *plugin.Runtime, subsWithConfigs []subWithConfig
azureObject: azureObject{
id: s.Id.Data,
subscription: *subWithConfig.sub.SubscriptionID,
region: s.Location.Data,
location: s.Location.Data,
service: "sql",
objectType: "server",
},
Expand Down Expand Up @@ -332,7 +332,7 @@ func discoverMySqlServers(runtime *plugin.Runtime, subsWithConfigs []subWithConf
azureObject: azureObject{
id: s.Id.Data,
subscription: *subWithConfig.sub.SubscriptionID,
region: s.Location.Data,
location: s.Location.Data,
service: "mysql",
objectType: "server",
},
Expand Down Expand Up @@ -365,7 +365,7 @@ func discoverPostgresqlServers(runtime *plugin.Runtime, subsWithConfigs []subWit
azureObject: azureObject{
id: s.Id.Data,
subscription: *subWithConfig.sub.SubscriptionID,
region: s.Location.Data,
location: s.Location.Data,
service: "postgresql",
objectType: "server",
},
Expand Down Expand Up @@ -398,7 +398,7 @@ func discoverMariadbServers(runtime *plugin.Runtime, subsWithConfigs []subWithCo
azureObject: azureObject{
id: s.Id.Data,
subscription: *subWithConfig.sub.SubscriptionID,
region: s.Location.Data,
location: s.Location.Data,
service: "mariadb",
objectType: "server",
},
Expand Down Expand Up @@ -431,7 +431,7 @@ func discoverStorageAccounts(runtime *plugin.Runtime, subsWithConfig []subWithCo
azureObject: azureObject{
id: a.Id.Data,
subscription: *subWithConfig.sub.SubscriptionID,
region: a.Location.Data,
location: a.Location.Data,
service: "storage",
objectType: "account",
},
Expand Down Expand Up @@ -470,7 +470,7 @@ func discoverStorageAccountsContainers(runtime *plugin.Runtime, subsWithConfig [
azureObject: azureObject{
id: c.Id.Data,
subscription: *subWithConfig.sub.SubscriptionID,
region: a.Location.Data,
location: a.Location.Data,
service: "storage",
objectType: "container",
},
Expand Down Expand Up @@ -504,7 +504,7 @@ func discoverSecurityGroups(runtime *plugin.Runtime, subsWithConfigs []subWithCo
azureObject: azureObject{
id: s.Id.Data,
subscription: *subWithConfig.sub.SubscriptionID,
region: s.Location.Data,
location: s.Location.Data,
service: "network",
objectType: "security-group",
},
Expand Down Expand Up @@ -537,7 +537,7 @@ func discoverVaults(runtime *plugin.Runtime, subsWithConfigs []subWithConfig) ([
azureObject: azureObject{
id: v.Id.Data,
subscription: *subWithConfig.sub.SubscriptionID,
region: v.Location.Data,
location: v.Location.Data,
service: "keyvault",
objectType: "vault",
},
Expand Down Expand Up @@ -725,7 +725,7 @@ func addInformationalLabels(l map[string]string, o mqlObject) map[string]string
if l == nil {
l = make(map[string]string)
}
l[RegionLabel] = o.azureObject.region
l[LocationLabel] = o.azureObject.location
l[SubscriptionLabel] = o.azureObject.subscription
return l
}
Expand Down

0 comments on commit ae6208a

Please sign in to comment.