Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -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 -}}
Comment on lines +723 to +728

Copilot AI Apr 21, 2026

Copy link

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.

Copilot uses AI. Check for mistakes.
{{- 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

Copilot AI Apr 21, 2026

Copy link

Choose a reason for hiding this comment

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

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.

Copilot uses AI. Check for mistakes.
{{- 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

Copilot AI Apr 21, 2026

Copy link

Choose a reason for hiding this comment

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

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.

Copilot uses AI. Check for mistakes.
{{- 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

Copilot AI Apr 21, 2026

Copy link

Choose a reason for hiding this comment

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

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.

Copilot uses AI. Check for mistakes.
{{- printf "%s:%s" $repo $tag -}}
{{- end -}}
{{- end -}}

{{/*
Get the value of podLabels field in the starrocksFESpec
*/}}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ spec:
{{- if .Values.initPassword.image }}
image: {{ .Values.initPassword.image }}
{{- else }}
image: {{ .Values.starrocksFESpec.image.repository }}:{{ include "starrockscluster.fe.image.tag" . }}
image: {{ include "starrockscluster.fe.image" . }}
{{- end }}
imagePullPolicy: IfNotPresent
{{- if .Values.initPassword.resources }}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ spec:
{{- if .Values.starrocksFESpec.shareProcessNamespace }}
shareProcessNamespace: {{ .Values.starrocksFESpec.shareProcessNamespace }}
{{- end }}
image: "{{ .Values.starrocksFESpec.image.repository }}:{{ include "starrockscluster.fe.image.tag" . }}"
image: "{{ include "starrockscluster.fe.image" . }}"
{{- if .Values.starrocksFESpec.entrypoint }}
command: ["bash", "-c"]
args:
Expand Down Expand Up @@ -293,7 +293,7 @@ spec:
{{- if .Values.starrocksBeSpec.shareProcessNamespace }}
shareProcessNamespace: {{ .Values.starrocksBeSpec.shareProcessNamespace }}
{{- end }}
image: "{{ .Values.starrocksBeSpec.image.repository }}:{{ include "starrockscluster.be.image.tag" . }}"
image: "{{ include "starrockscluster.be.image" . }}"
{{- if .Values.starrocksBeSpec.entrypoint }}
command: ["bash", "-c"]
args:
Expand Down Expand Up @@ -594,7 +594,7 @@ spec:
{{- if .Values.starrocksCnSpec.shareProcessNamespace }}
shareProcessNamespace: {{ .Values.starrocksCnSpec.shareProcessNamespace }}
{{- end }}
image: "{{ .Values.starrocksCnSpec.image.repository }}:{{ include "starrockscluster.cn.image.tag" . }}"
image: "{{ include "starrockscluster.cn.image" . }}"
{{- if .Values.starrocksCnSpec.entrypoint }}
command: ["bash", "-c"]
args:
Expand Down Expand Up @@ -897,7 +897,7 @@ spec:
{{- if .Values.starrocksFeProxySpec.enabled }}
starRocksFeProxySpec:
{{- if .Values.starrocksFeProxySpec.image.repository }}
image: "{{ .Values.starrocksFeProxySpec.image.repository }}:{{ .Values.starrocksFeProxySpec.image.tag }}"
image: "{{ include "starrockscluster.feproxy.image" . }}"
{{- end }}
{{- if .Values.starrocksFeProxySpec.imagePullSecrets }}
imagePullSecrets:
Expand Down
23 changes: 22 additions & 1 deletion helm-charts/charts/kube-starrocks/charts/starrocks/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,16 @@
# nameOverride is used to set the prefix of the resources created by starrocks chart.
nameOverride: "kube-starrocks"

# Global image registry prefix for use by parent charts.
# When set, it is prepended to every image repository in the chart.
# For example, setting registry: "my-registry.example.com" transforms
# "starrocks/fe-ubuntu:tag" into "my-registry.example.com/starrocks/fe-ubuntu:tag".
# This can be overridden by starrocksCluster.componentValues.image.registry (cluster-wide)
# or by the individual image.registry fields in each component spec.
global:
image:
registry: ""

# This configuration is used to modify the root password during initial deployment.
# After deployment is completed, it won't take effect to modify the password here and to do a `helm upgrade`.
# It also supports providing a secret name that contains a password, using the password in the secret instead of the plaintext in the values.yaml.
Expand Down Expand Up @@ -128,6 +138,9 @@ starrocksCluster:
componentValues:
image:
tag: "3.5-latest"
# registry overrides global.image.registry for all components (FE, BE, CN).
# Individual component image.registry fields take priority over this.
registry: ""
# hostAliases allows adding entries to /etc/hosts inside the containers.
hostAliases: []
# - ip: "127.0.0.1"
Expand Down Expand Up @@ -199,6 +212,8 @@ starrocksFESpec:
# image sliced by "repository:tag"
repository: starrocks/fe-ubuntu
tag: ""
# registry overrides the global image.registry for this component only.
registry: ""
imagePullPolicy: IfNotPresent
# Specify the entrypoint for FE.
# By default, the operator will use '/opt/starrocks/fe_entrypoint.sh' as a command and use '$(FE_SERVICE_NAME)' as args in the container spec.
Expand Down Expand Up @@ -386,7 +401,7 @@ starrocksFESpec:
# mountPath: /tmp
# persistentVolumeClaimRetentionPolicy specifies the retention policy for PersistentVolumeClaims associated with the component.
# The whenDeleted field is supported for all components, and it determines whether to delete PVCs when the StatefulSet is deleted.
# The whenScaled field is only supported for the CN component.
# The whenScaled field is only supported for the CN component.
persistentVolumeClaimRetentionPolicy:
# whenDeleted: Delete
# the config for start fe. the base information as follows.
Expand Down Expand Up @@ -526,6 +541,8 @@ starrocksCnSpec:
# image sliced by "repository:tag"
repository: starrocks/cn-ubuntu
tag: ""
# registry overrides the global image.registry for this component only.
registry: ""
imagePullPolicy: IfNotPresent
# Specify the entrypoint for CN.
# By default, the operator will use '/opt/starrocks/cn_entrypoint.sh' as command, and use '$(FE_SERVICE_NAME)' as args in container spec.
Expand Down Expand Up @@ -891,6 +908,8 @@ starrocksBeSpec:
# image sliced by "repository:tag"
repository: starrocks/be-ubuntu
tag: ""
# registry overrides the global image.registry for this component only.
registry: ""
imagePullPolicy: IfNotPresent
# Specify the entrypoint for BE.
# By default, the operator will use '/opt/starrocks/be_entrypoint.sh' as command, and use '$(FE_SERVICE_NAME)' as args in the container spec.
Expand Down Expand Up @@ -1249,6 +1268,8 @@ starrocksFeProxySpec:
image:
repository: ""
tag: ""
# registry overrides the global image.registry for this component only.
registry: ""
resources:
requests:
cpu: 1
Expand Down
23 changes: 22 additions & 1 deletion helm-charts/charts/kube-starrocks/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -131,6 +131,16 @@ starrocks:
# nameOverride is used to set the prefix of the resources created by starrocks chart.
nameOverride: "kube-starrocks"

# Global image registry prefix for use by parent charts.
# When set, it is prepended to every image repository in the chart.
# For example, setting registry: "my-registry.example.com" transforms
# "starrocks/fe-ubuntu:tag" into "my-registry.example.com/starrocks/fe-ubuntu:tag".
# This can be overridden by starrocksCluster.componentValues.image.registry (cluster-wide)
# or by the individual image.registry fields in each component spec.
global:
image:
registry: ""

# This configuration is used to modify the root password during initial deployment.
# After deployment is completed, it won't take effect to modify the password here and to do a `helm upgrade`.
# It also supports providing a secret name that contains a password, using the password in the secret instead of the plaintext in the values.yaml.
Expand Down Expand Up @@ -254,6 +264,9 @@ starrocks:
componentValues:
image:
tag: "3.5-latest"
# registry overrides global.image.registry for all components (FE, BE, CN).
# Individual component image.registry fields take priority over this.
registry: ""
# hostAliases allows adding entries to /etc/hosts inside the containers.
hostAliases: []
# - ip: "127.0.0.1"
Expand Down Expand Up @@ -325,6 +338,8 @@ starrocks:
# image sliced by "repository:tag"
repository: starrocks/fe-ubuntu
tag: ""
# registry overrides the global image.registry for this component only.
registry: ""
imagePullPolicy: IfNotPresent
# Specify the entrypoint for FE.
# By default, the operator will use '/opt/starrocks/fe_entrypoint.sh' as a command and use '$(FE_SERVICE_NAME)' as args in the container spec.
Expand Down Expand Up @@ -512,7 +527,7 @@ starrocks:
# mountPath: /tmp
# persistentVolumeClaimRetentionPolicy specifies the retention policy for PersistentVolumeClaims associated with the component.
# The whenDeleted field is supported for all components, and it determines whether to delete PVCs when the StatefulSet is deleted.
# The whenScaled field is only supported for the CN component.
# The whenScaled field is only supported for the CN component.
persistentVolumeClaimRetentionPolicy:
# whenDeleted: Delete
# the config for start fe. the base information as follows.
Expand Down Expand Up @@ -652,6 +667,8 @@ starrocks:
# image sliced by "repository:tag"
repository: starrocks/cn-ubuntu
tag: ""
# registry overrides the global image.registry for this component only.
registry: ""
imagePullPolicy: IfNotPresent
# Specify the entrypoint for CN.
# By default, the operator will use '/opt/starrocks/cn_entrypoint.sh' as command, and use '$(FE_SERVICE_NAME)' as args in container spec.
Expand Down Expand Up @@ -1017,6 +1034,8 @@ starrocks:
# image sliced by "repository:tag"
repository: starrocks/be-ubuntu
tag: ""
# registry overrides the global image.registry for this component only.
registry: ""
imagePullPolicy: IfNotPresent
# Specify the entrypoint for BE.
# By default, the operator will use '/opt/starrocks/be_entrypoint.sh' as command, and use '$(FE_SERVICE_NAME)' as args in the container spec.
Expand Down Expand Up @@ -1375,6 +1394,8 @@ starrocks:
image:
repository: ""
tag: ""
# registry overrides the global image.registry for this component only.
registry: ""
resources:
requests:
cpu: 1
Expand Down
Loading