-
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?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -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 -}} | ||||||||||||||||||||||
| {{- 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
|
||||||||||||||||||||||
| {{- 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 }} |
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.