-
Notifications
You must be signed in to change notification settings - Fork 24
add logic in _helpers.tpl when using sha256 of image #32
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
There was a problem hiding this 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.
| {{- else }} | ||
| {{- printf "%s:%s" $repository $tag -}} | ||
| {{- end }} |
Copilot
AI
Dec 14, 2025
There was a problem hiding this comment.
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.
| {{- 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 }} |
| @@ -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 -}} | |||
Copilot
AI
Dec 14, 2025
There was a problem hiding this comment.
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.
No description provided.