From 1826ae88f86a924032f81140f4ae5c9f9c15ecf9 Mon Sep 17 00:00:00 2001 From: Andreas Gerstmayr Date: Thu, 30 Jul 2026 17:57:19 +0200 Subject: [PATCH] chore: fix noisy operator logs Signed-off-by: Andreas Gerstmayr --- internal/certrotation/handlers/rotate_certs.go | 2 +- internal/controller/tempo/common.go | 4 ++-- internal/manifests/gateway/openshift.go | 2 +- internal/manifests/monolithic/statefulset_test.go | 4 ++-- internal/manifests/networkpolicies/discovery.go | 2 +- 5 files changed, 7 insertions(+), 7 deletions(-) diff --git a/internal/certrotation/handlers/rotate_certs.go b/internal/certrotation/handlers/rotate_certs.go index 1fd739626..74971aceb 100644 --- a/internal/certrotation/handlers/rotate_certs.go +++ b/internal/certrotation/handlers/rotate_certs.go @@ -107,7 +107,7 @@ func CreateOrRotateCertificates(ctx context.Context, log logr.Logger, return kverrors.Wrap(err, "failed to add certificate hash annotations", "name", req.String()) } - ll.Info("certificate rotation completed successfully, hash annotations added") + ll.V(1).Info("certificate rotation completed successfully, hash annotations added") return nil } diff --git a/internal/controller/tempo/common.go b/internal/controller/tempo/common.go index d0ca07e62..8572dd3c8 100644 --- a/internal/controller/tempo/common.go +++ b/internal/controller/tempo/common.go @@ -246,8 +246,8 @@ func getTenantParams( tenantsData, err := gateway.GetGatewayTenantsData(ctx, k8sclient, namespace, name) if err != nil { - // just log the error the secret is not created if the loop for an instance runs for the first time. - log.Info("Failed to get gateway secret and/or tenants.yaml", "error", err) + // The gateway secret is created during reconciliation, so it won't exist on the first reconcile. + log.Info("Failed to get gateway secret and/or tenants.yaml. This is expected during the first reconcile", "error", err) } return nil, tenantsData, nil diff --git a/internal/manifests/gateway/openshift.go b/internal/manifests/gateway/openshift.go index a658f518e..45ea81791 100644 --- a/internal/manifests/gateway/openshift.go +++ b/internal/manifests/gateway/openshift.go @@ -236,7 +236,7 @@ func NewOpaContainer(ctrlConfig configv1alpha1.ProjectConfig, tenants v1alpha1.T Args: args, Ports: []corev1.ContainerPort{ { - Name: "public", + Name: "opa-http", ContainerPort: gatewayOPAHTTPPort, Protocol: corev1.ProtocolTCP, }, diff --git a/internal/manifests/monolithic/statefulset_test.go b/internal/manifests/monolithic/statefulset_test.go index 15789d521..1d1d25bd0 100644 --- a/internal/manifests/monolithic/statefulset_test.go +++ b/internal/manifests/monolithic/statefulset_test.go @@ -958,7 +958,7 @@ func TestStatefulsetGateway(t *testing.T) { }, Ports: []corev1.ContainerPort{ { - Name: "public", + Name: "opa-http", ContainerPort: 8082, Protocol: corev1.ProtocolTCP, }, @@ -1244,7 +1244,7 @@ func TestStatefulsetGatewayRBAC(t *testing.T) { }, Ports: []corev1.ContainerPort{ { - Name: "public", + Name: "opa-http", ContainerPort: 8082, Protocol: corev1.ProtocolTCP, }, diff --git a/internal/manifests/networkpolicies/discovery.go b/internal/manifests/networkpolicies/discovery.go index cf56cc759..94418a2ef 100644 --- a/internal/manifests/networkpolicies/discovery.go +++ b/internal/manifests/networkpolicies/discovery.go @@ -79,7 +79,7 @@ func DiscoverKubernetesAPIServer(ctx context.Context, k8sClient client.Client) m return fallbackKubeAPIServerInfo() } - logger.Info("discovered Kubernetes API server endpoints", + logger.V(1).Info("discovered Kubernetes API server endpoints", "ports", len(ports), "ips", len(ips)) return manifestutils.KubeAPIServerInfo{