From 6fd13f563e96f5dc80d09c22b33399d784740cc7 Mon Sep 17 00:00:00 2001 From: Pascal Fischer Date: Tue, 30 May 2023 19:09:16 +0200 Subject: [PATCH] use new policy-rule object --- management/server/metrics/selfhosted.go | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/management/server/metrics/selfhosted.go b/management/server/metrics/selfhosted.go index 6c549fcf7..2e9be3b94 100644 --- a/management/server/metrics/selfhosted.go +++ b/management/server/metrics/selfhosted.go @@ -200,13 +200,14 @@ func (w *Worker) generateProperties() properties { routes = routes + len(account.Routes) nameservers = nameservers + len(account.NameServerGroups) - for _, rule := range account.Rules { - policyRule := rule.ToPolicyRule() - rulesProtocol[string(policyRule.Protocol)]++ - if policyRule.Bidirectional { - rulesDirection["bidirectional"]++ - } else { - rulesDirection["oneway"]++ + for _, policy := range account.Policies { + for _, rule := range policy.Rules { + rulesProtocol[string(rule.Protocol)]++ + if rule.Bidirectional { + rulesDirection["bidirectional"]++ + } else { + rulesDirection["oneway"]++ + } } }