Skip to content

Commit

Permalink
helm template creating
Browse files Browse the repository at this point in the history
  • Loading branch information
NikolaiKuziaevQubership committed Feb 4, 2025
1 parent 00e26f9 commit c5ab43a
Show file tree
Hide file tree
Showing 5 changed files with 18 additions and 5 deletions.
2 changes: 1 addition & 1 deletion charts/env-checker/templates/CronJob.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ spec:
serviceAccountName: {{ .Values.serviceAccount.name }}
containers:
- name: '{{ printf "%s-cronjob" .Values.SERVICE_NAME }}'
image: '{{ .Values.IMAGE_REPOSITORY }}:{{ .Values.TAG }}'
image: {{ template "env-checker.image" . }}
command: [ "/bin/sh", "-c", "$(ENVIRONMENT_CHECKER_CRON_JOB_COMMAND)" ]
env:
- name: "ENVIRONMENT_CHECKER_CRON_JOB_COMMAND"
Expand Down
2 changes: 1 addition & 1 deletion charts/env-checker/templates/Deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ spec:
{{- end }}
containers:
- name: '{{ .Values.SERVICE_NAME }}'
image: '{{ .Values.IMAGE_REPOSITORY }}:{{ .Values.TAG }}'
image: {{ template "env-checker.image" . }}
ports:
- name: web
containerPort: 8888
Expand Down
2 changes: 1 addition & 1 deletion charts/env-checker/templates/Job.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ spec:
restartPolicy: Never
containers:
- name: '{{ printf "%s-job" .Values.SERVICE }}'
image: '{{ .Values.IMAGE_REPOSITORY }}:{{ .Values.TAG }}'
image: {{ template "env-checker.image" . }}
command: [ "/bin/sh", "-c", "$(ENVIRONMENT_CHECKER_JOB_COMMAND)" ]
env:
- name: "ENVIRONMENT_CHECKER_JOB_COMMAND"
Expand Down
13 changes: 13 additions & 0 deletions charts/env-checker/templates/_helpers.tpl
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
{{/*
Find a env-checker image in various places.
Image can be found from:
* specified by user from .Values.IMAGE_REPOSITORY and .Values.TAG
* default value
*/}}
{{- define "env-checker.image" -}}
{{- if and (not (empty .Values.IMAGE_REPOSITORY)) (not (empty .Values.TAG)) -}}
{{- printf "%s:%s" .Values.IMAGE_REPOSITORY .Values.TAG -}}
{{- else -}}
{{- printf "ghcr.io/netcracker/qubership-env-checker:main" -}}
{{- end -}}
{{- end -}}
4 changes: 2 additions & 2 deletions charts/env-checker/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@ MANAGED_BY: "saasDeployer"
NAMESPACE: 'default'
#Artifact descriptor version which is installed.
ARTIFACT_DESCRIPTOR_VERSION : ''
IMAGE_REPOSITORY: 'ghcr.io/netcracker/qubership-env-checker'
TAG: 'main'
#IMAGE_REPOSITORY: 'ghcr.io/netcracker/qubership-env-checker'
#TAG: 'main'
DELIMITER: "-"
DEPLOYMENT_SESSION_ID: ''
CLOUD_NAME: 'qubership'
Expand Down

0 comments on commit c5ab43a

Please sign in to comment.