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

Commit

Permalink
Merge pull request #12 from vshn/fix-zone
Browse files Browse the repository at this point in the history
Always use the bucket zone "cloudscale"
  • Loading branch information
davidgubler authored Aug 17, 2022
2 parents 335ecab + 338bc7b commit 9ec9177
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
7 changes: 3 additions & 4 deletions accumulate.go
Original file line number Diff line number Diff line change
Expand Up @@ -69,10 +69,9 @@ func accumulateBucketMetricsForObjectsUser(accumulated map[AccumulateKey]uint64,
if namespace == "" {
return fmt.Errorf("no namespace information found on objectsUser")
}
zone := objectsUser.Tags["zone"]
if zone == "" {
return fmt.Errorf("no zone information found on objectsUser")
}
// For now all the buckets have the same zone. This may change in the future if Cloudscale decides to have different
// prices for different locations.
zone := sourceZones[0]

sourceStorage := AccumulateKey{
Query: sourceQueryStorage,
Expand Down
2 changes: 1 addition & 1 deletion accumulate_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ func assertEqualfUint64(t *testing.T, expected uint64, actual uint64, msg string
}

func TestAccumulateBucketMetricsForObjectsUser(t *testing.T) {
zone := "appuio-cloudscale-ch-lpg"
zone := "cloudscale"
tenant := "inity"
namespace := "testnamespace"

Expand Down
5 changes: 3 additions & 2 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,9 @@ var (
sourceQueryTrafficOut = "object-storage-traffic-out"
sourceQueryRequests = "object-storage-requests"

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

// source "

Expand Down

0 comments on commit 9ec9177

Please sign in to comment.