Skip to content

Commit

Permalink
add KUBEBLOCKS_IMAGE_REGISTRY in deployment.yaml and use it in object…
Browse files Browse the repository at this point in the history
…_builder.go
  • Loading branch information
stocrkc committed Nov 28, 2024
1 parent 19fb384 commit 9d41b33
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 1 deletion.
2 changes: 2 additions & 0 deletions deploy/helm/templates/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,8 @@ spec:
value: {{ .Values.image.imagePullSecrets | toJson | quote }}
- name: KUBEBLOCKS_TOOLS_IMAGE
value: "{{ .Values.image.registry | default "docker.io" }}/{{ .Values.image.tools.repository }}:{{ .Values.image.tag | default .Chart.AppVersion }}"
- name: KUBEBLOCKS_IMAGE_REGISTRY
value: "{{ .Values.image.registry | default "docker.io" }}"
- name: KUBEBLOCKS_SERVICEACCOUNT_NAME
value: {{ include "kubeblocks.serviceAccountName" . }}
{{- if .Capabilities.APIVersions.Has "snapshot.storage.k8s.io/v1" }}
Expand Down
1 change: 1 addition & 0 deletions pkg/constant/const.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ const (
KBToolsImage = "KUBEBLOCKS_TOOLS_IMAGE"
KBImagePullPolicy = "KUBEBLOCKS_IMAGE_PULL_POLICY"
KBImagePullSecrets = "KUBEBLOCKS_IMAGE_PULL_SECRETS"
KBImageRegistry = "KUBEBLOCKS_IMAGE_REGISTRY"
)

const (
Expand Down
2 changes: 1 addition & 1 deletion pkg/controller/instanceset/object_builder.go
Original file line number Diff line number Diff line change
Expand Up @@ -254,7 +254,7 @@ func injectCustomRoleProbeContainer(its *workloads.InstanceSet, template *corev1
agentPath := strings.Join([]string{roleAgentVolumeMountPath, roleAgentName}, "/")
initContainer := corev1.Container{
Name: roleAgentInstallerName,
Image: shell2httpImage,
Image: strings.Join([]string{viper.GetString(constant.KBImageRegistry), shell2httpImage}, "/"),
ImagePullPolicy: corev1.PullIfNotPresent,
VolumeMounts: []corev1.VolumeMount{agentVolumeMount},
Command: []string{
Expand Down

0 comments on commit 9d41b33

Please sign in to comment.