Skip to content
Open
Changes from all commits
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
4 changes: 4 additions & 0 deletions charts/kafka-ui/templates/_helpers.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,11 @@ This allows us to check if the registry of the image is specified or not.
{{- $repository := .Values.image.repository -}}
{{- $tag := .Values.image.tag | default .Chart.AppVersion -}}
Copy link

Copilot AI Dec 14, 2025

Choose a reason for hiding this comment

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

The variable name '$tag' is misleading because it can now contain either a tag (with ':' separator) or a digest (with '@sha256:' prefix). Consider renaming it to something more generic like '$tagOrDigest' or '$imageIdentifier' to better reflect its dual purpose and improve code clarity.

Copilot uses AI. Check for mistakes.
{{- if $registryName }}
{{- if contains "@sha256" $tag }}
{{- printf "%s/%s%s" $registryName $repository $tag -}}
{{- else }}
{{- printf "%s/%s:%s" $registryName $repository $tag -}}
{{- end }}
{{- else }}
{{- printf "%s:%s" $repository $tag -}}
{{- end }}
Comment on lines 84 to 86
Copy link

Copilot AI Dec 14, 2025

Choose a reason for hiding this comment

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

The SHA256 digest handling logic is inconsistent. When no registry is specified, the code still uses the colon separator, which will produce an invalid image reference if the tag contains a SHA256 digest. The same conditional logic that was added for the registry case (lines 79-83) should also be applied here to handle SHA256 digests correctly.

Suggested change
{{- else }}
{{- printf "%s:%s" $repository $tag -}}
{{- end }}
{{- else }}
{{- if contains "@sha256" $tag }}
{{- printf "%s%s" $repository $tag -}}
{{- else }}
{{- printf "%s:%s" $repository $tag -}}
{{- end }}
{{- end }}

Copilot uses AI. Check for mistakes.
Expand Down
Loading