Skip to content

Commit d146472

Browse files
committed
remove backednTLSPolicy check
1 parent 5abf6b1 commit d146472

File tree

2 files changed

+4
-15
lines changed

2 files changed

+4
-15
lines changed

internal/mode/static/telemetry/collector.go

Lines changed: 1 addition & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -188,7 +188,7 @@ func collectGraphResourceCount(
188188
}
189189
}
190190

191-
ngfResourceCounts.BackendTLSPolicyCount = computeBackendTLSPolicyCount(g.BackendTLSPolicies)
191+
ngfResourceCounts.BackendTLSPolicyCount = int64(len(g.BackendTLSPolicies))
192192

193193
return ngfResourceCounts, nil
194194
}
@@ -324,14 +324,3 @@ func collectClusterInformation(ctx context.Context, k8sClient client.Reader) (cl
324324

325325
return clusterInfo, nil
326326
}
327-
328-
func computeBackendTLSPolicyCount(policies map[types.NamespacedName]*graph.BackendTLSPolicy) (
329-
backendTLSPolicyCount int64,
330-
) {
331-
for _, policy := range policies {
332-
if policy.Valid {
333-
backendTLSPolicyCount = backendTLSPolicyCount + 1
334-
}
335-
}
336-
return backendTLSPolicyCount
337-
}

internal/mode/static/telemetry/collector_test.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -300,8 +300,8 @@ var _ = Describe("Collector", Ordered, func() {
300300
client.ObjectKeyFromObject(nilsvc): {},
301301
},
302302
BackendTLSPolicies: map[types.NamespacedName]*graph.BackendTLSPolicy{
303-
{Namespace: "test", Name: "bgPolicy-1"}: {Valid: true},
304-
{Namespace: "test", Name: "bgPolicy-2"}: {Valid: true},
303+
{Namespace: "test", Name: "bgPolicy-1"}: {},
304+
{Namespace: "test", Name: "bgPolicy-2"}: {},
305305
{Namespace: "test", Name: "bgPolicy-3"}: {},
306306
},
307307
}
@@ -349,7 +349,7 @@ var _ = Describe("Collector", Ordered, func() {
349349
ServiceCount: 3,
350350
EndpointCount: 4,
351351
GRPCRouteCount: 2,
352-
BackendTLSPolicyCount: 2,
352+
BackendTLSPolicyCount: 3,
353353
}
354354
expData.ClusterVersion = "1.29.2"
355355
expData.ClusterPlatform = "kind"

0 commit comments

Comments
 (0)