Skip to content
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
fix incorrect pipeline chaining resulting in port always being 0
  • Loading branch information
attributeerror committed Mar 6, 2026
commit 05b5c9323675207c3cfc328aaf808c935950929d
2 changes: 1 addition & 1 deletion charts/kafka-ui/templates/http-route.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ spec:
- group: ''
kind: Service
name: {{ include "kafka-ui.fullname" $ }}
port: {{ tpl ($.Values.service.port | default "80" | quote) $ }}
port: {{ (tpl (default "80" ($.Values.service.port)) $) | int }}
weight: 1
{{- end }}
Comment on lines +42 to +49
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 | 🔴 Critical

Critical: Template execution failure and indentation error on port line.

Two issues on line 47:

  1. Tab character: Line 47 uses a tab for indentation instead of spaces, which will cause YAML parsing errors in the rendered output.

  2. tpl on integer: $.Values.service.port is an integer (default 80). The tpl function expects a string, so this will fail with "expected string; found int" when the template executes.

Since port values typically don't need Go template interpolation, tpl is unnecessary here.

🐛 Proposed fix
     backendRefs:
     - group: ''
       kind: Service
       name: {{ include "kafka-ui.fullname" $ }}
-	  port: {{ (tpl (default "80" ($.Values.service.port)) $) | int }}
+      port: {{ $.Values.service.port | default 80 | int }}
       weight: 1
📝 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
{{- if $route.shouldRouteToService }}
backendRefs:
- group: ''
kind: Service
name: {{ include "kafka-ui.fullname" $ }}
port: {{ (tpl (default "80" ($.Values.service.port)) $) | int }}
weight: 1
{{- end }}
{{- if $route.shouldRouteToService }}
backendRefs:
- group: ''
kind: Service
name: {{ include "kafka-ui.fullname" $ }}
port: {{ $.Values.service.port | default 80 | int }}
weight: 1
{{- end }}
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@charts/kafka-ui/templates/http-route.yaml` around lines 42 - 49, Replace the
tab-indented, tpl-wrapped port line with a space-indented, non-tpl expression
that treats port as an integer; specifically, in the http-route.yaml backendRefs
block (the section guarded by {{- if $route.shouldRouteToService }} and
referencing include "kafka-ui.fullname" and $.Values.service.port) remove the
tpl call and the tab, then render the port as an integer, e.g. use a
spaces-indented line like: port: {{ $.Values.service.port | default 80 | int }}
so the template no longer calls tpl on an int and the YAML indentation uses
spaces.

{{- if $route.filters }}
Expand Down