Repository navigation
[Feature] Add global.image.registry support for custom registry prefix #748
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 |
|---|---|---|
|
|
@@ -715,6 +715,69 @@ Get the value of tag field in the starrocksCnSpec | |
| {{- end -}} | ||
| {{- end -}} | ||
|
|
||
| {{/* | ||
| Build the full FE image reference, prepending the registry when set. | ||
| Priority (highest wins): component image.registry > componentValues.image.registry > global.image.registry. | ||
| */}} | ||
| {{- define "starrockscluster.fe.image" -}} | ||
| {{- $registry := coalesce .Values.starrocksFESpec.image.registry .Values.starrocksCluster.componentValues.image.registry .Values.global.image.registry -}} | ||
| {{- $repo := .Values.starrocksFESpec.image.repository -}} | ||
| {{- $tag := include "starrockscluster.fe.image.tag" . -}} | ||
| {{- if $registry -}} | ||
| {{- printf "%s/%s:%s" $registry $repo $tag -}} | ||
| {{- else -}} | ||
| {{- printf "%s:%s" $repo $tag -}} | ||
| {{- end -}} | ||
| {{- end -}} | ||
|
|
||
| {{/* | ||
| Build the full BE image reference, prepending the registry when set. | ||
| Priority (highest wins): component image.registry > componentValues.image.registry > global.image.registry. | ||
| */}} | ||
| {{- define "starrockscluster.be.image" -}} | ||
| {{- $registry := coalesce .Values.starrocksBeSpec.image.registry .Values.starrocksCluster.componentValues.image.registry .Values.global.image.registry -}} | ||
| {{- $repo := .Values.starrocksBeSpec.image.repository -}} | ||
| {{- $tag := include "starrockscluster.be.image.tag" . -}} | ||
| {{- if $registry -}} | ||
| {{- printf "%s/%s:%s" $registry $repo $tag -}} | ||
| {{- else -}} | ||
|
Comment on lines
+738
to
+743
|
||
| {{- printf "%s:%s" $repo $tag -}} | ||
| {{- end -}} | ||
| {{- end -}} | ||
|
|
||
| {{/* | ||
| Build the full CN image reference, prepending the registry when set. | ||
| Priority (highest wins): component image.registry > componentValues.image.registry > global.image.registry. | ||
| */}} | ||
| {{- define "starrockscluster.cn.image" -}} | ||
| {{- $registry := coalesce .Values.starrocksCnSpec.image.registry .Values.starrocksCluster.componentValues.image.registry .Values.global.image.registry -}} | ||
| {{- $repo := .Values.starrocksCnSpec.image.repository -}} | ||
| {{- $tag := include "starrockscluster.cn.image.tag" . -}} | ||
| {{- if $registry -}} | ||
| {{- printf "%s/%s:%s" $registry $repo $tag -}} | ||
| {{- else -}} | ||
|
Comment on lines
+753
to
+758
|
||
| {{- printf "%s:%s" $repo $tag -}} | ||
| {{- end -}} | ||
| {{- end -}} | ||
|
|
||
| {{/* | ||
| Build the full FE proxy image reference, prepending the registry when set. | ||
| Only used when starrocksFeProxySpec.image.repository is non-empty; otherwise | ||
| the operator falls back to its built-in default (nginx:1.24.0). | ||
| Priority (highest wins): component image.registry > global.image.registry. | ||
| Note: feproxy is not covered by componentValues. | ||
| */}} | ||
| {{- define "starrockscluster.feproxy.image" -}} | ||
| {{- $registry := coalesce .Values.starrocksFeProxySpec.image.registry .Values.global.image.registry -}} | ||
| {{- $repo := .Values.starrocksFeProxySpec.image.repository -}} | ||
| {{- $tag := .Values.starrocksFeProxySpec.image.tag -}} | ||
| {{- if $registry -}} | ||
| {{- printf "%s/%s:%s" $registry $repo $tag -}} | ||
| {{- else -}} | ||
|
Comment on lines
+771
to
+776
|
||
| {{- printf "%s:%s" $repo $tag -}} | ||
| {{- end -}} | ||
| {{- end -}} | ||
|
|
||
| {{/* | ||
| Get the value of podLabels field in the starrocksFESpec | ||
| */}} | ||
|
|
||
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 registry/repo concatenation can produce an invalid image reference if the user provides a registry with a trailing slash (e.g. "my-registry/") or a repository with a leading slash, resulting in "registry//repo:tag". Consider normalizing before printf (e.g., trimSuffix "/" on the registry and trimPrefix "/" on the repo) and using the normalized values in both branches.