Repository navigation
Conversation
00e3674 to
26be7c3
Compare
|
Please note that I have an helm unittest (https://github.com/helm-unittest/) file that tests the combinations of global.image.registry / starrocksComponents.image.registry and individual registry values to validate that the proper overrides are working as intended. I didn't commit the file because this would enlarge the merge request substantially :
|
This allows to use private registries without having to override
the repository. This is how public charts usually work: split between
registry, repository and image tag. Bitnami used to work like this.
Adds a global.image.registry value (default: "") that is prepended to
all component image repositories. Each component (FE, BE, CN, FE proxy)
also exposes its own image.registry field to allow per-component
overrides; the component-level value takes priority over the global one.
New helpers (starrockscluster.fe/be/cn/feproxy.image) build the full
image reference in one place, keeping templates clean. The init-password
job inherits the FE registry automatically.
Priority order (ascending, last wins):
global.image.registry
< starrocksCluster.componentValues.image.registry
< starrocks{FE,BE,CN}Spec.image.registry
The feproxy component is excluded from componentValues (as it already was
for image.tag) and resolves directly from its own registry or
global.image.registry.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Signed-off-by: Guillaume Bienkowski <guillaume.bienkowski@braincube.com>
26be7c3 to
7d870f7
Compare
There was a problem hiding this comment.
Pull request overview
Adds configurable image registry prefixing to the StarRocks Helm charts so users can target private registries without overriding each component’s repository.
Changes:
- Introduces
global.image.registryand per-componentimage.registryvalues, plus a cluster-wide override atstarrocksCluster.componentValues.image.registry. - Centralizes FE/BE/CN/FEProxy image string construction in new Helm helpers and updates templates to use them.
- Updates the init-password Job to inherit the FE image (including registry behavior) via the new helper.
Reviewed changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
| helm-charts/charts/kube-starrocks/values.yaml | Exposes new registry values in the parent chart values (subchart-scoped under starrocks.*). |
| helm-charts/charts/kube-starrocks/charts/starrocks/values.yaml | Adds global.image.registry and per-component registry fields to the subchart defaults/docs. |
| helm-charts/charts/kube-starrocks/charts/starrocks/templates/starrockscluster.yaml | Switches FE/BE/CN/FEProxy image: fields to use centralized helpers. |
| helm-charts/charts/kube-starrocks/charts/starrocks/templates/init-pwd/job.yaml | Uses FE image helper so init-password job inherits registry/tag logic. |
| helm-charts/charts/kube-starrocks/charts/starrocks/templates/_helpers.tpl | Adds new image-building helpers implementing the registry precedence rules. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| {{- $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 -}} |
There was a problem hiding this comment.
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.
| {{- $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 -}} |
There was a problem hiding this comment.
Same as FE image helper: joining registry/repo without trimming can yield "registry//repo:tag" when registry ends with "/" (or repo starts with "/"), which is not a valid image reference. Normalize registry/repo before formatting.
| {{- $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 -}} |
There was a problem hiding this comment.
Same normalization concern here: if global/component registry is set with a trailing slash, the formatted image becomes "registry//repo:tag". Trimming the slash (and any leading slash on repo) avoids generating invalid image refs.
| {{- $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 -}} |
There was a problem hiding this comment.
The FE proxy image helper has the same potential double-slash issue when registry ends with "/" (or repo starts with "/"), producing "registry//repo:tag". It’s safer to trimSuffix "/" on the registry and trimPrefix "/" on the repo before building the image string.
Description
This allows to use private registries without having to override the repository. This is how public charts usually work: split between registry, repository and image tag. Bitnami used to work like this.
Adds a global.image.registry value (default: "") that is prepended to all component image repositories. Each component (FE, BE, CN, FE proxy) also exposes its own image.registry field to allow per-component overrides; the component-level value takes priority over the global one.
New helpers (starrockscluster.fe/be/cn/feproxy.image) build the full image reference in one place, keeping templates clean. The init-password job inherits the FE registry automatically.
Priority order (ascending, last wins):
global.image.registry
< starrocksCluster.componentValues.image.registry
< starrocks{FE,BE,CN}Spec.image.registry
The feproxy component is excluded from componentValues (as it already was for image.tag) and resolves directly from its own registry or global.image.registry.
This commit was partially helped with Claude, I added it in the commit Co-Authors.
Related Issue(s)
None
Checklist
For operator, please complete the following checklist:
make generateto generate the code.golangci-lint runto check the code style.make testto run UT.make manifeststo update the yaml files of CRD.For helm chart, please complete the following checklist:
file of starrocks chart.
scriptsdirectory, runbash create-parent-chart-values.shto update the values.yaml file of the parentchart( kube-starrocks chart).