diff --git a/accumulate.go b/accumulate.go index 4d02d4b..50b39cd 100644 --- a/accumulate.go +++ b/accumulate.go @@ -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, diff --git a/accumulate_test.go b/accumulate_test.go index 076f645..96e4ddf 100644 --- a/accumulate_test.go +++ b/accumulate_test.go @@ -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" diff --git a/main.go b/main.go index 4e4aef5..d226c76 100644 --- a/main.go +++ b/main.go @@ -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 "