Skip to content

Commit

Permalink
GDB-7983: Use Chart.AppVersion by default
Browse files Browse the repository at this point in the history
Templates will now use `Chart.AppVersion` by default
unless `images.graphdb.tag` is specified
  • Loading branch information
mihailradkov committed Jan 29, 2024
1 parent e40d417 commit d4a4e15
Show file tree
Hide file tree
Showing 10 changed files with 23 additions and 20 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@

- Updated the default ingress's path type to `ImplementationSpecific`
- Updated graphdb.properties example file
- Templates will now use `Chart.AppVersion` by default unless `images.graphdb.tag` is specified.

## Version 10.5.1-R2

Expand Down
22 changes: 11 additions & 11 deletions templates/_helpers.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -38,18 +38,18 @@ Otherwise it is left blank and cluster default will be used.
{{- end }}

{{/*
Renders full name of the graphdb pod
Render the container image for GraphDB
*/}}
{{- define "graphdb.renderFullImageName" -}}
{{- $fullImageName := .image.repository -}}

{{- if or .globalRegistry .image.registry -}}
{{- $fullImageName = printf "%s/%s" ( .image.registry | default .globalRegistry) .image.repository -}}
{{- define "graphdb.image" -}}
{{- $registry := .Values.images.graphdb.registry -}}
{{- $repository := .Values.images.graphdb.repository -}}
{{- $tag := .Values.images.graphdb.tag | default .Chart.AppVersion | toString -}}
{{- if and .Values.global .Values.global.imageRegistry -}}
{{- $registry = .Values.global.imageRegistry -}}
{{- end -}}

{{- if .image.tag -}}
{{- printf "%s:%s" $fullImageName .image.tag -}}
{{- if $registry -}}
{{- printf "%s/%s:%s" $registry $repository $tag -}}
{{- else -}}
{{- print $fullImageName -}}
{{- printf "%s:%s" $repository $tag -}}
{{- end -}}
{{- end -}}
{{- end }}
2 changes: 1 addition & 1 deletion templates/graphdb-cluster-proxy.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ spec:
{{- include "graphdb.combinedImagePullSecrets" $ | nindent 8 }}
containers:
- name: graphdb-proxy
image: {{ include "graphdb.renderFullImageName" (dict "globalRegistry" $.Values.global.imageRegistry "image" $.Values.images.graphdb) }}
image: {{ include "graphdb.image" . }}
imagePullPolicy: {{ $.Values.deployment.imagePullPolicy }}
command: ["/opt/graphdb/dist/bin/cluster-proxy"]
envFrom:
Expand Down
4 changes: 2 additions & 2 deletions templates/graphdb-node.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ spec:
{{- include "graphdb.combinedImagePullSecrets" $ | nindent 8 }}
containers:
- name: graphdb-node
image: {{ include "graphdb.renderFullImageName" (dict "globalRegistry" $.Values.global.imageRegistry "image" $.Values.images.graphdb) }}
image: {{ include "graphdb.image" . }}
imagePullPolicy: {{ $.Values.deployment.imagePullPolicy }}
{{- with .Values.graphdb.node.command }}
command: {{ toYaml . | nindent 12 }}
Expand Down Expand Up @@ -154,7 +154,7 @@ spec:
initContainers:
# PROVISION SETTINGS AND SECURITY
- name: provision-settings
image: {{ include "graphdb.renderFullImageName" (dict "globalRegistry" $.Values.global.imageRegistry "image" $.Values.images.busybox) }}
image: {{ include "graphdb.image" . }}
imagePullPolicy: {{ $.Values.deployment.imagePullPolicy }}
volumeMounts:
{{- if hasKey $.Values.graphdb.node.persistence "volumeClaimTemplateSpec" }}
Expand Down
2 changes: 1 addition & 1 deletion templates/jobs/patch-cluster-job.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ spec:
{{- $.Values.graphdb.jobPodSecurityContext | toYaml | nindent 8 }}
containers:
- name: patch-cluster
image: {{ include "graphdb.renderFullImageName" (dict "globalRegistry" $.Values.global.imageRegistry "image" $.Values.images.graphdb) }}
image: {{ include "graphdb.image" . }}
envFrom:
- secretRef:
name: graphdb-provision-user
Expand Down
2 changes: 1 addition & 1 deletion templates/jobs/post-start-job.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ spec:
{{- $.Values.graphdb.jobPodSecurityContext | toYaml | nindent 8 }}
containers:
- name: create-graphdb-cluster
image: {{ include "graphdb.renderFullImageName" (dict "globalRegistry" $.Values.global.imageRegistry "image" $.Values.images.graphdb) }}
image: {{ include "graphdb.image" . }}
envFrom:
- secretRef:
name: graphdb-provision-user
Expand Down
2 changes: 1 addition & 1 deletion templates/jobs/provision-repositories-job.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ spec:
{{- $.Values.graphdb.jobPodSecurityContext | toYaml | nindent 8 }}
containers:
- name: provision-repositories
image: {{ include "graphdb.renderFullImageName" (dict "globalRegistry" $.Values.global.imageRegistry "image" $.Values.images.graphdb) }}
image: {{ include "graphdb.image" . }}
envFrom:
- secretRef:
name: graphdb-provision-user
Expand Down
2 changes: 1 addition & 1 deletion templates/jobs/scale-down-cluster-job.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ spec:
{{- $.Values.graphdb.jobPodSecurityContext | toYaml | nindent 8 }}
containers:
- name: scale-down-cluster
image: {{ include "graphdb.renderFullImageName" (dict "globalRegistry" $.Values.global.imageRegistry "image" $.Values.images.graphdb) }}
image: {{ include "graphdb.image" . }}
envFrom:
- secretRef:
name: graphdb-provision-user
Expand Down
2 changes: 1 addition & 1 deletion templates/jobs/scale-up-cluster-job.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ spec:
{{- $.Values.graphdb.jobPodSecurityContext | toYaml | nindent 8 }}
containers:
- name: scale-up-cluster
image: {{ include "graphdb.renderFullImageName" (dict "globalRegistry" $.Values.global.imageRegistry "image" $.Values.images.graphdb) }}
image: {{ include "graphdb.image" . }}
envFrom:
- secretRef:
name: graphdb-provision-user
Expand Down
4 changes: 3 additions & 1 deletion values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,10 @@ global:
# Top lvl flat for easier maintenance
images:
graphdb:
registry: docker.io
repository: ontotext/graphdb
tag: "10.5.1"
# If specified, overrides Chart.AppVersion
tag: ""
busybox:
repository: busybox
tag: "1.31"
Expand Down

0 comments on commit d4a4e15

Please sign in to comment.