fix(plugin-access-manager): clean dead OTEL defaults and fix SWAGGER_HOST service names#1158
fix(plugin-access-manager): clean dead OTEL defaults and fix SWAGGER_HOST service names#1158gandalf-at-lerian wants to merge 1 commit intomainfrom
Conversation
- Remove stale midaz-grafana.midaz.svc.cluster.local:4317 defaults from OTEL_EXPORTER_OTLP_ENDPOINT in plugin-access-manager (auth + identity) and plugin-fees configmap templates. The deployment templates already inject OTEL_EXPORTER_OTLP_ENDPOINT via HOST_IP:4317, making these configmap defaults dead config. - Fix SWAGGER_HOST defaults in plugin-access-manager configmap templates: - auth: plugin-auth -> plugin-access-manager-auth - identity: plugin-identity -> plugin-access-manager-identity Part of DSINT-1009.
WalkthroughKubernetes ConfigMap templates in three plugin charts updated their environment variable defaults. The Changes
Comment |
There was a problem hiding this comment.
Actionable comments posted: 2
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In `@charts/plugin-access-manager/templates/auth/configmap.yaml`:
- Line 37: The SWAGGER_HOST default hardcodes "plugin-access-manager-auth"
causing drift from the Service name; update the default for
.Values.auth.configmap.SWAGGER_HOST to derive from the same fullname helper used
for the Service by using include "plugin-auth.fullname" (pass the current
context) and append the cluster DNS suffix so SWAGGER_HOST is built from the
helper output rather than a hardcoded string; adjust the SWAGGER_HOST line that
references .Values.auth.configmap.SWAGGER_HOST accordingly.
In `@charts/plugin-access-manager/templates/identity/configmap.yaml`:
- Line 33: The SWAGGER_HOST default is hardcoded to
"plugin-access-manager-identity" causing name drift; update the default to use
the same helper that generates the Service/ConfigMap name by calling the chart
template include "plugin-identity.fullname" (pass the current context) as the
host base instead of the literal string, keeping port and cluster domain suffix
and leaving Values.identity.configmap.SWAGGER_HOST override behavior intact.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: ASSERTIVE
Plan: Pro
Run ID: 55015847-732e-4216-a301-9c6adf5add9b
📒 Files selected for processing (3)
charts/plugin-access-manager/templates/auth/configmap.yamlcharts/plugin-access-manager/templates/identity/configmap.yamlcharts/plugin-fees/templates/fees/configmap.yaml
| SWAGGER_DESCRIPTION: {{ .Values.auth.configmap.SWAGGER_DESCRIPTION | default "This is a swagger documentation for the Plugin Auth API" | quote }} | ||
| SWAGGER_VERSION: {{ .Values.auth.image.tag | quote }} | ||
| SWAGGER_HOST: {{ .Values.auth.configmap.SWAGGER_HOST | default (printf "plugin-auth.%s.svc.cluster.local" .Release.Namespace) | quote }} | ||
| SWAGGER_HOST: {{ .Values.auth.configmap.SWAGGER_HOST | default (printf "plugin-access-manager-auth.%s.svc.cluster.local" .Release.Namespace) | quote }} |
There was a problem hiding this comment.
🧩 Analysis chain
🏁 Script executed:
#!/bin/bash
# Verify configmap host default vs service naming source for auth
rg -n 'SWAGGER_HOST|name:\s*\{\{\s*include\s+"plugin-auth.fullname"' \
charts/plugin-access-manager/templates/auth/configmap.yaml \
charts/plugin-access-manager/templates/auth/service.yaml
rg -n 'define "plugin-auth.fullname"' charts/plugin-access-manager/templates/helpers.tplRepository: LerianStudio/helm
Length of output: 531
Use the same fullname helper for SWAGGER_HOST default as the Service name.
The Service name (charts/plugin-access-manager/templates/auth/service.yaml, line 4) is derived from include "plugin-auth.fullname", but the SWAGGER_HOST default on line 37 hardcodes plugin-access-manager-auth. If the helper's behavior changes (e.g., when .Values.auth.name is customized), the Service name will reflect this change but the default SWAGGER_HOST will not, causing a mismatch.
🔧 Proposed fix
- SWAGGER_HOST: {{ .Values.auth.configmap.SWAGGER_HOST | default (printf "plugin-access-manager-auth.%s.svc.cluster.local" .Release.Namespace) | quote }}
+ SWAGGER_HOST: {{ .Values.auth.configmap.SWAGGER_HOST | default (printf "%s.%s.svc.cluster.local" (include "plugin-auth.fullname" .) .Release.Namespace) | quote }}📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| SWAGGER_HOST: {{ .Values.auth.configmap.SWAGGER_HOST | default (printf "plugin-access-manager-auth.%s.svc.cluster.local" .Release.Namespace) | quote }} | |
| SWAGGER_HOST: {{ .Values.auth.configmap.SWAGGER_HOST | default (printf "%s.%s.svc.cluster.local" (include "plugin-auth.fullname" .) .Release.Namespace) | quote }} |
🧰 Tools
🪛 YAMLlint (1.38.0)
[error] 37-37: too many spaces inside braces
(braces)
[error] 37-37: too many spaces inside braces
(braces)
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.
In `@charts/plugin-access-manager/templates/auth/configmap.yaml` at line 37, The
SWAGGER_HOST default hardcodes "plugin-access-manager-auth" causing drift from
the Service name; update the default for .Values.auth.configmap.SWAGGER_HOST to
derive from the same fullname helper used for the Service by using include
"plugin-auth.fullname" (pass the current context) and append the cluster DNS
suffix so SWAGGER_HOST is built from the helper output rather than a hardcoded
string; adjust the SWAGGER_HOST line that references
.Values.auth.configmap.SWAGGER_HOST accordingly.
| SWAGGER_DESCRIPTION: {{ .Values.identity.configmap.SWAGGER_DESCRIPTION | default "The Identity API provides a set of endpoints for managing users and client credentials." | quote }} | ||
| SWAGGER_VERSION: {{ .Values.identity.image.tag | quote }} | ||
| SWAGGER_HOST: {{ .Values.identity.configmap.SWAGGER_HOST | default (printf "plugin-identity.%s.svc.cluster.local:4001" .Release.Namespace) | quote }} | ||
| SWAGGER_HOST: {{ .Values.identity.configmap.SWAGGER_HOST | default (printf "plugin-access-manager-identity.%s.svc.cluster.local:4001" .Release.Namespace) | quote }} |
There was a problem hiding this comment.
🧩 Analysis chain
🏁 Script executed:
# First, let's find and examine the relevant files
find . -type f -name "configmap.yaml" | grep identityRepository: LerianStudio/helm
Length of output: 125
🏁 Script executed:
# Check the configmap.yaml file content around line 33
cat -n charts/plugin-access-manager/templates/identity/configmap.yaml | head -50Repository: LerianStudio/helm
Length of output: 4051
🏁 Script executed:
# Check the service.yaml file to see how it uses the fullname helper
cat -n charts/plugin-access-manager/templates/identity/service.yaml | head -20Repository: LerianStudio/helm
Length of output: 662
🏁 Script executed:
# Check the helpers.tpl file to see the fullname helper definition
cat -n charts/plugin-access-manager/templates/helpers.tplRepository: LerianStudio/helm
Length of output: 7292
Use plugin-identity.fullname in SWAGGER_HOST default to prevent name drift.
Line 33 hardcodes plugin-access-manager-identity, while both the Service and ConfigMap names use include "plugin-identity.fullname". This creates a name drift risk if .Values.identity.name is customized—the Service name will change but SWAGGER_HOST will still point to the hardcoded value. Align them to the same source.
🔧 Proposed fix
- SWAGGER_HOST: {{ .Values.identity.configmap.SWAGGER_HOST | default (printf "plugin-access-manager-identity.%s.svc.cluster.local:4001" .Release.Namespace) | quote }}
+ SWAGGER_HOST: {{ .Values.identity.configmap.SWAGGER_HOST | default (printf "%s.%s.svc.cluster.local:4001" (include "plugin-identity.fullname" .) .Release.Namespace) | quote }}📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| SWAGGER_HOST: {{ .Values.identity.configmap.SWAGGER_HOST | default (printf "plugin-access-manager-identity.%s.svc.cluster.local:4001" .Release.Namespace) | quote }} | |
| SWAGGER_HOST: {{ .Values.identity.configmap.SWAGGER_HOST | default (printf "%s.%s.svc.cluster.local:4001" (include "plugin-identity.fullname" .) .Release.Namespace) | quote }} |
🧰 Tools
🪛 YAMLlint (1.38.0)
[error] 33-33: too many spaces inside braces
(braces)
[error] 33-33: too many spaces inside braces
(braces)
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.
In `@charts/plugin-access-manager/templates/identity/configmap.yaml` at line 33,
The SWAGGER_HOST default is hardcoded to "plugin-access-manager-identity"
causing name drift; update the default to use the same helper that generates the
Service/ConfigMap name by calling the chart template include
"plugin-identity.fullname" (pass the current context) as the host base instead
of the literal string, keeping port and cluster domain suffix and leaving
Values.identity.configmap.SWAGGER_HOST override behavior intact.
What
Cleans up dead config and fixes stale service name references in configmap templates.
Changes
OTEL_EXPORTER_OTLP_ENDPOINT default → empty (3 templates)
plugin-access-manager/auth/configmap.yamlplugin-access-manager/identity/configmap.yamlplugin-fees/fees/configmap.yamlThe old default (
midaz-grafana.midaz.svc.cluster.local:4317) referenced a non-existent service. The deployment templates already inject this env var viaHOST_IP:4317(DaemonSet hostPort), so the configmap value is never used. Setting to empty eliminates the misleading reference.SWAGGER_HOST default → correct service name (2 templates)
plugin-access-manager/auth/configmap.yaml:plugin-auth→plugin-access-manager-authplugin-access-manager/identity/configmap.yaml:plugin-identity→plugin-access-manager-identityThese still used pre-rename service names from when the services were called
plugin-authandplugin-identity.Context
Part of DSINT-1009 — GitOps Cross-Reference Audit.