Skip to content

Suppress warning log about duplicate port names #7903

@simonpasquier

Description

@simonpasquier

Is there an existing issue for this?

  • I have searched the existing issues

What happened?

Description

When running the operator on a Kubernetes v1.34 cluster, we see warnings such as:

Warning: spec.template.spec.containers[1].ports[0]: duplicate port name \"reloader-web\" with 
spec.template.spec.initContainers[0].ports[0], services and probes that select ports by name will use 
spec.template.spec.initContainers[0].ports[0]

Steps to Reproduce

  1. Install the operator on Kubernetes v1.34
  2. Deploy a Prometheus resource.
  3. Check the operator's logs.

Expected Result

No warnings

Actual Result

Prometheus Operator Version

main

Kubernetes Version

1.34

Kubernetes Cluster Type

kind

How did you deploy Prometheus-Operator?

prometheus-operator/kube-prometheus

Manifests

prometheus-operator log output

ts=2025-09-11T08:59:41.670521808Z level=info caller=/home/simon/workspace/pkg/mod/k8s.io/client-go@v0.34.0/rest/warnings.go:110 msg="Warning: spec.template.spec.containers[1].ports[0]: duplicate port name \"reloader-web\" with spec.template.spec.initContainers[0].ports[0], services and probes that select ports by name will use spec.template.spec.initContainers[0].ports[0]"
ts=2025-09-11T08:59:41.671304267Z level=info caller=/home/simon/workspace/src/github.com/prometheus-operator/prometheus-operator/pkg/prometheus/server/operator.go:836 msg="sync prometheus" component=prometheus-controller key=default/prometheus

Anything else?

No response

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions