Skip to content
This repository was archived by the owner on Jan 19, 2023. It is now read-only.

Commit 9ec9177

Browse files
authored
Merge pull request #12 from vshn/fix-zone
Always use the bucket zone "cloudscale"
2 parents 335ecab + 338bc7b commit 9ec9177

File tree

3 files changed

+7
-7
lines changed

3 files changed

+7
-7
lines changed

accumulate.go

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -69,10 +69,9 @@ func accumulateBucketMetricsForObjectsUser(accumulated map[AccumulateKey]uint64,
6969
if namespace == "" {
7070
return fmt.Errorf("no namespace information found on objectsUser")
7171
}
72-
zone := objectsUser.Tags["zone"]
73-
if zone == "" {
74-
return fmt.Errorf("no zone information found on objectsUser")
75-
}
72+
// For now all the buckets have the same zone. This may change in the future if Cloudscale decides to have different
73+
// prices for different locations.
74+
zone := sourceZones[0]
7675

7776
sourceStorage := AccumulateKey{
7877
Query: sourceQueryStorage,

accumulate_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ func assertEqualfUint64(t *testing.T, expected uint64, actual uint64, msg string
2121
}
2222

2323
func TestAccumulateBucketMetricsForObjectsUser(t *testing.T) {
24-
zone := "appuio-cloudscale-ch-lpg"
24+
zone := "cloudscale"
2525
tenant := "inity"
2626
namespace := "testnamespace"
2727

main.go

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,8 +39,9 @@ var (
3939
sourceQueryTrafficOut = "object-storage-traffic-out"
4040
sourceQueryRequests = "object-storage-requests"
4141

42-
// we must use the correct zones, otherwise the appuio-odoo-adapter will not work correctly
43-
sourceZones = []string{"c-appuio-cloudscale-lpg-2"}
42+
// SourceZone represents the zone of the bucket, not of the cluster where the request for the bucket originated.
43+
// All the zones we use here must be known to the appuio-odoo-adapter as well.
44+
sourceZones = []string{"cloudscale"}
4445

4546
// source "
4647

0 commit comments

Comments
 (0)