8000 fix(config-reloader): use distinct port name for init container to av… by sureshkrishnan-v · Pull Request #7904 · prometheus-operator/prometheus-operator · GitHub
[go: up one dir, main page]

Skip to content

Conversation

sureshkrishnan-v
Copy link
Contributor
@sureshkrishnan-v sureshkrishnan-v commented Sep 12, 2025

This PR fixes warnings about duplicate port names between the config-reloader and init-config-reloader containers.
Currently, both containers expose a port named reloader-web. With Kubernetes v1.34, the client-go library surfaces this as a warning:

Warning: duplicate port name "reloader-web" between init and regular containers

To resolve this, the init container now uses a distinct port name (reloader-init) while keeping a different port number (8081).
This avoids name clashes without affecting services, probes, or existing functionality (which rely on the regular container’s reloader-web port).

Closes: #7903

Type of change :

BUGFIX (non-breaking change which fixes an issue)

Changelog entry
[BUGFIX] Use distinct port name for init container to avoid duplicate port name warnings.

…oid duplicate port name warnings (prometheus-operator#7903)

Signed-off-by: Suresh Krishnan V <suresh@atatus.com>
… avoid duplicate warnings

Signed-off-by: Suresh Krishnan V <suresh@atatus.com>
@sureshkrishnan-v sureshkrishnan-v requested a review from a team as a code owner September 12, 2025 10:29
Copy link
Contributor
@simonpasquier simonpasquier left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for tackling this! It looks like the change breaks the end-to-end tests. I'd recommend running your changes locally with the scripts/run-external.sh as explained in
https://github.com/prometheus-operator/prometheus-operator/blob/main/TESTING.md#end-to-end-tests

@simonpasquier
Copy link
Contributor

The CI run saves diagnostic artifacts (e.g. logs and cluster resources) so you might get some insights downloading the zip file and checking the operator's logs.

image

@simonpasquier
Copy link
Contributor

@sureshkrishnan-atatus would you need some help on this PR?

@sureshkrishnan-v
Copy link
Contributor Author

@sureshkrishnan-atatus would you need some help on this PR?

yes sure i have tried but it fails again and again i don't know why

@simonpasquier
Copy link
Contributor
simonpasquier commented Sep 18, 2025

Looking at https://github.com/prometheus-operator/prometheus-operator/actions/runs/17715943067/artifacts/4007464859 the status of the Prometheus resource says

  status:
    paused: false
    replicas: 0
    updatedreplicas: 0
    availablereplicas: 0
    unavailablereplicas: 0
    conditions:
    - type: Available
      status: "False"
      lasttransitiontime: "2025-09-14T20:13:25Z"
      reason: StatefulSetNotFound
      message: 'shard 0: statefulset operatorupgrade-operatorupgrade-t2lh40-1-51ffd430/prometheus-operator-upgrade
        not found'
      observedgeneration: 1
    - type: Reconciled
      status: "False"
      lasttransitiontime: "2025-09-14T20:13:25Z"
      reason: ReconciliationFailed
      message: 'creating statefulset failed: StatefulSet.apps "prometheus-operator-upgrade"
        is invalid: spec.template.spec.initContainers[0].ports[0].name: Invalid value:
        "reloader-web-init": must be no more than 15 characters'
      observedgeneration: 1

We need to use a shorter port name, maybe reloader-init?

@sureshkrishnan-v
Copy link
Contributor Author

reloader-init

yeah that would be great i will check with that

…oid duplicate port name warnings

Signed-off-by: Suresh Krishnan V <suresh@atatus.com>
Copy link
Contributor
@simonpasquier simonpasquier left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks! Glad you managed to make your first contribution to the project 🎉

@simonpasquier simonpasquier merged commit d4e4529 into prometheus-operator:main Sep 19, 2025
28 of 29 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Suppress warning log about duplicate port names
3 participants
0