From c5cd964da2f2ec1951ba72d45b54eef8246e96ee Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jakub=20B=C5=82aszczyk?= Date: Fri, 23 Feb 2024 10:54:40 +0100 Subject: [PATCH] fix: allow passing empty metrics config (#2682) Signed-off-by: Demonsthere --- api/v1alpha1/envoygateway_helpers.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/api/v1alpha1/envoygateway_helpers.go b/api/v1alpha1/envoygateway_helpers.go index 25866ed1203..09077991c87 100644 --- a/api/v1alpha1/envoygateway_helpers.go +++ b/api/v1alpha1/envoygateway_helpers.go @@ -104,12 +104,12 @@ func DefaultEnvoyGatewayLogging() *EnvoyGatewayLogging { // GetEnvoyGatewayTelemetry returns the EnvoyGatewayTelemetry of EnvoyGateway or a default EnvoyGatewayTelemetry if unspecified. func (e *EnvoyGateway) GetEnvoyGatewayTelemetry() *EnvoyGatewayTelemetry { if e.Telemetry != nil { - if e.Telemetry.Metrics.Prometheus == nil { - e.Telemetry.Metrics.Prometheus = DefaultEnvoyGatewayPrometheus() - } if e.Telemetry.Metrics == nil { e.Telemetry.Metrics = DefaultEnvoyGatewayMetrics() } + if e.Telemetry.Metrics.Prometheus == nil { + e.Telemetry.Metrics.Prometheus = DefaultEnvoyGatewayPrometheus() + } return e.Telemetry } e.Telemetry = DefaultEnvoyGatewayTelemetry()