fix(alertmanager): replace hardcoded externalUrl with dynamic ingress endpoint#4913
fix(alertmanager): replace hardcoded externalUrl with dynamic ingress endpoint#4913eve-scality wants to merge 2 commits intodevelopment/133.0from
Conversation
… endpoint Part of the implementation plan from scality/agent-task#131.
|
/approve |
Hello eve-scality,My role is to assist you with the merge of this Available options
Available commands
Status report is not available. |
Waiting for approvalThe following approvals are needed before I can proceed with the merge:
Peer approvals must include at least 1 approval from the following list: The following options are set: approve |
|
LGTM |
| alertmanagerConfigSelector: {} | ||
| automountServiceAccountToken: true | ||
| externalUrl: http://prometheus-operator-alertmanager.metalk8s-monitoring:9093 | ||
| externalUrl: {% endraw -%}{{ cp_ingress_ep }}{%- raw %}/api/alertmanager |
There was a problem hiding this comment.
| externalUrl: {% endraw -%}{{ cp_ingress_ep }}{%- raw %}/api/alertmanager | |
| externalUrl: {% endraw -%}{{ cp_ingress_ep }}{%- raw %} |
FAILED LINT codegen [0s] |
…rt.sls - Move the dynamic externalUrl override into charts/kube-prometheus-stack.yaml using __var__(salt.metalk8s_network.get_control_plane_ingress_endpoint()) so codegen produces the desired output (fixes lint:codegen failure). - Drop the /api/alertmanager suffix from externalUrl per review feedback; the suffix is already handled by the UI ingress route. - Regenerate salt/metalk8s/addons/prometheus-operator/deployed/chart.sls. Part of the implementation plan from #4913.
@cerebro-check CompleteAddressed both the CI failure and @JBWatenbergScality's inline review. What changedThe previous commit edited the generated file Fix
Net diff vs. base branch (
|
@cerebro-check: Human Confirmation NeededI detected failing CI checks on this PR and analyzed the logs, but my confidence that the failure is caused by these PR changes is 5% — below the 80% threshold required to auto-fix. Failing Checks
AnalysisRe-check statusI re-read all PR threads and re-validated the current branch state ( Inline comments — already addressed
|
@cerebro-check Complete@cerebro-check — no changes neededAfter re-reading all threads and validating the branch state at
About the failing
|
Summary
Replace the hardcoded Alertmanager
externalUrl(http://prometheus-operator-alertmanager.metalk8s-monitoring:9093) inchart.slswith a dynamically resolved value fromsalt.metalk8s_network.get_control_plane_ingress_endpoint(). This ensures the Alertmanager CR reflects the correct public ingress URL (e.g.https://<cp-ip>/api/alertmanager) and is re-applied whenever the control-plane ingress endpoint changes.References
Step Adherence
Changes
{%- set cp_ingress_ep = salt.metalk8s_network.get_control_plane_ingress_endpoint() %}in the header section ofchart.sls(line 11, alongside existinggrafana,prometheus, andalertmanagerset statements, before the{% raw %}block).externalUrl: http://prometheus-operator-alertmanager.metalk8s-monitoring:9093withexternalUrl: {% endraw -%}{{ cp_ingress_ep }}{%- raw %}/api/alertmanager, following the canonical inline variable injection pattern used on the adjacentimage:line.Deviations
None.
Test Strategy
{% raw %}/{% endraw %}block balance was verified to be maintained (no Jinja parse errors).salt/tests/unit/formulas/fixtures/salt.py) already hasregister_basic("metalk8s_network.get_control_plane_ingress_endpoint")registered withMagicMock(return_value="https://192.168.1.240:8443"), ensuring the template renders correctly in unit tests./api/alertmanagersuffix matches the existing ingress rule inui/deployed/ingress.sls.