Skip to content

Commit 9c81877

Browse files
authored
Merge pull request #4 from Netcracker/helm-template-refactoring
Helm template refactoring
2 parents 52de58f + 155534a commit 9c81877

File tree

3 files changed

+16
-3
lines changed

3 files changed

+16
-3
lines changed
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
{{/*
2+
Find a diag-proxy image in various places.
3+
Image can be found from:
4+
* specified by user from .Values.IMAGE_REPOSITORY and .Values.TAG
5+
* default value
6+
*/}}
7+
{{- define "diag-proxy.image" -}}
8+
{{- if and (not (empty .Values.IMAGE_REPOSITORY)) (not (empty .Values.TAG)) -}}
9+
{{- printf "%s:%s" .Values.IMAGE_REPOSITORY .Values.TAG -}}
10+
{{- else -}}
11+
{{- printf "ghcr.io/netcracker/diag-proxy:main" -}}
12+
{{- end -}}
13+
{{- end -}}

charts/diag-proxy/templates/deployment.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ spec:
5454
{{- end }}
5555
containers:
5656
- name: {{ .Values.SERVICE_NAME }}
57-
image: '{{ .Values.IMAGE_REPOSITORY }}:{{ .Values.TAG }}'
57+
image: {{ template "diag-proxy.image" . }}
5858
ports:
5959
- name: cdt-tcp
6060
containerPort: 1715

charts/diag-proxy/values.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@ ARTIFACT_DESCRIPTOR_VERSION: ''
66

77
# -- Image coordinates, next two values will be joined as:
88
# IMAGE_REPOSITORY:TAG
9-
IMAGE_REPOSITORY: ghcr.io/netcracker/diag-proxy
10-
TAG: main
9+
#IMAGE_REPOSITORY: ghcr.io/netcracker/diag-proxy
10+
#TAG: main
1111
# --- The name of the secret in Kubernetes that provides access to the private Docker registry
1212
imagePullSecrets: []
1313
### Deployment parameters

0 commit comments

Comments
 (0)