Skip to content

Commit

Permalink
refactoring for loop
Browse files Browse the repository at this point in the history
  • Loading branch information
lukasz.widera@vshn.ch committed Oct 2, 2024
1 parent ee7b527 commit c615442
Showing 1 changed file with 5 additions and 7 deletions.
12 changes: 5 additions & 7 deletions pkg/cloudscale/objectstorage.go
Original file line number Diff line number Diff line change
Expand Up @@ -114,17 +114,15 @@ func (o *ObjectStorage) GetMetrics(ctx context.Context, billingDate time.Time) (
return nil, err
}

for bucket := range bucketMap {
bucketName := bucketMap[bucket].BucketMetricsData.Subject.BucketName
if val, ok := buckets[bucketName]; ok {
bucketMap[bucket].Zone = val.Zone
for name, bucket := range bucketMap {
if val, ok := buckets[name]; ok {
bucket.Zone = val.Zone
}

// assign organisation to bucketMap
if val, ok := nsTenants[bucketMap[bucket].Namespace]; ok {
bucketMap[bucket].Organization = val
if val, ok := nsTenants[bucket.Namespace]; ok {
bucket.Organization = val
}

}

allRecords := make([]odoo.OdooMeteredBillingRecord, 0)
Expand Down

0 comments on commit c615442

Please sign in to comment.