Skip to content

fix(plugin-access-manager): clean dead OTEL defaults and fix SWAGGER_HOST service names#1158

Open
gandalf-at-lerian wants to merge 1 commit intomainfrom
fix/clean-dead-otel-swagger-defaults
Open

fix(plugin-access-manager): clean dead OTEL defaults and fix SWAGGER_HOST service names#1158
gandalf-at-lerian wants to merge 1 commit intomainfrom
fix/clean-dead-otel-swagger-defaults

Conversation

@gandalf-at-lerian
Copy link
Copy Markdown
Contributor

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.yaml
  • plugin-access-manager/identity/configmap.yaml
  • plugin-fees/fees/configmap.yaml

The old default (midaz-grafana.midaz.svc.cluster.local:4317) referenced a non-existent service. The deployment templates already inject this env var via HOST_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-authplugin-access-manager-auth
  • plugin-access-manager/identity/configmap.yaml: plugin-identityplugin-access-manager-identity

These still used pre-rename service names from when the services were called plugin-auth and plugin-identity.

Context

Part of DSINT-1009 — GitOps Cross-Reference Audit.

- 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.
@coderabbitai
Copy link
Copy Markdown

coderabbitai bot commented Apr 1, 2026

Walkthrough

Kubernetes ConfigMap templates in three plugin charts updated their environment variable defaults. The SWAGGER_HOST keys in plugin-access-manager's auth and identity ConfigMaps now reference renamed service endpoints. The OTEL_EXPORTER_OTLP_ENDPOINT across all three ConfigMaps changed from pointing to a specific Grafana service to defaulting to an empty string.

Changes

Cohort / File(s) Summary
Plugin Access Manager ConfigMaps
charts/plugin-access-manager/templates/auth/configmap.yaml, charts/plugin-access-manager/templates/identity/configmap.yaml
Updated SWAGGER_HOST defaults to reference renamed service endpoints (plugin-access-manager-auth and plugin-access-manager-identity respectively). Changed OTEL_EXPORTER_OTLP_ENDPOINT defaults from midaz-grafana.midaz.svc.cluster.local:4317 to empty string.
Plugin Fees ConfigMap
charts/plugin-fees/templates/fees/configmap.yaml
Updated OTEL_EXPORTER_OTLP_ENDPOINT default from midaz-grafana.midaz.svc.cluster.local:4317 to empty string.

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Copy Markdown
Member

@guimoreirar guimoreirar left a comment

Choose a reason for hiding this comment

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

LGTM

@guimoreirar guimoreirar changed the title fix: clean dead OTEL defaults and fix SWAGGER_HOST service names fix(plugin-access-manager): clean dead OTEL defaults and fix SWAGGER_HOST service names Apr 1, 2026
Copy link
Copy Markdown

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

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

📥 Commits

Reviewing files that changed from the base of the PR and between 4b9d173 and 76909b8.

📒 Files selected for processing (3)
  • charts/plugin-access-manager/templates/auth/configmap.yaml
  • charts/plugin-access-manager/templates/identity/configmap.yaml
  • charts/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 }}
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟠 Major

🧩 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.tpl

Repository: 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.

Suggested change
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 }}
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟠 Major

🧩 Analysis chain

🏁 Script executed:

# First, let's find and examine the relevant files
find . -type f -name "configmap.yaml" | grep identity

Repository: 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 -50

Repository: 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 -20

Repository: 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.tpl

Repository: 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.

Suggested change
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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants