Skip to content

Conversation

@chris7532
Copy link

No description provided.

@chris7532 chris7532 requested a review from a team as a code owner December 9, 2024 10:45
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR adds support for SHA256 image digests in the Kafka-UI Helm chart's image name template helper function. The change enables users to reference container images by their SHA256 digest instead of by tag, which provides immutable image references.

  • Adds conditional logic to detect SHA256 digests in the image tag value
  • Modifies the image name formatting to omit the colon separator when using SHA256 digests

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines 84 to 86
{{- else }}
{{- printf "%s:%s" $repository $tag -}}
{{- end }}
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.
@@ -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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants