Skip to content

Commit

Permalink
fix: Improve image name definitions
Browse files Browse the repository at this point in the history
  • Loading branch information
AntiD2ta committed Apr 27, 2024
1 parent 6fea479 commit a5f3c15
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 5 deletions.
8 changes: 8 additions & 0 deletions charts/espresso/templates/_helpers.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{{/*
Create a formatted image string with repository and tag
*/}}
{{- define "espresso.build_image_name" -}}
{{- $repository := index . 0 -}}
{{- $tag := index . 1 -}}
{{- printf "%s:%s" $repository $tag | quote -}}
{{- end -}}
10 changes: 5 additions & 5 deletions charts/espresso/templates/statefulset.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -24,14 +24,14 @@ spec:
{{- if $.Values.externalSecrets.enabled }}
initContainers:
- name: keygen # Generates keys for the sequencer
image: {{ $.Values.image.repository }}:{{ $.Values.image.tag }}
image: {{ include "espresso.build_image_name" (list $.Values.image.repository $.Values.image.tag) }}
imagePullPolicy: {{ $.Values.image.pullPolicy }}
command: ["keygen", "-o", "/keys", "-n", "{{ $specs.replicaCount }}"]
volumeMounts:
- name: keys
mountPath: /keys
- name: keystore-cli-pv-keys # Updates Secret Manager with private keys in the proper format
image: {{ $.Values.keystoreCLI.image.repository }}:{{ $.Values.keystoreCLI.image.tag }}
image: {{ include "espresso.build_image_name" (list $.Values.keystoreCLI.image.repository $.Values.keystoreCLI.image.tag) }}
imagePullPolicy: {{ $.Values.keystoreCLI.image.pullPolicy }}
args: ["pv-keys"]
env:
Expand All @@ -45,7 +45,7 @@ spec:
- name: keys
mountPath: /keys
- name: init-setenv # Sets keys environment variables for the sequencer
image: "{{ $.Values.initImage.repository }}:{{ $.Values.initImage.tag }}"
image: {{ include "espresso.build_image_name" (list $.Values.initImage.repository $.Values.initImage.tag) }}
imagePullPolicy: {{ $.Values.initImage.pullPolicy }}
command: ["/bin/sh", "-c"]
args:
Expand All @@ -65,7 +65,7 @@ spec:
mountPath: /etc/espresso
{{- if contains "storage-sql" $specs.args }}
- name: keystore-cli-db-keys # Updates Secret Manager with DB credentials in the proper format
image: {{ $.Values.keystoreCLI.image.repository }}:{{ $.Values.keystoreCLI.image.tag }}
image: {{ include "espresso.build_image_name" (list $.Values.keystoreCLI.image.repository $.Values.keystoreCLI.image.tag) }}
imagePullPolicy: {{ $.Values.keystoreCLI.image.pullPolicy }}
args: ["db-keys"]
env:
Expand All @@ -84,7 +84,7 @@ spec:
{{- end }}
containers:
- name: "sequencer-{{ $type }}"
image: "{{ $.Values.image.repository }}:{{ $.Values.image.tag }}"
image: {{ include "espresso.build_image_name" (list $.Values.image.repository $.Values.image.tag) }}
imagePullPolicy: {{ $.Values.image.pullPolicy }}
command: ["sequencer"]
args:
Expand Down

0 comments on commit a5f3c15

Please sign in to comment.