Skip to content

Commit

Permalink
Merge pull request #40 from permitio/raz/per-5022-make-image-version-…
Browse files Browse the repository at this point in the history
…dynamic

remove imageRegistry value and added image object
  • Loading branch information
RazcoDev authored Apr 23, 2023
2 parents fedca7f + 90d34ba commit d911ab6
Show file tree
Hide file tree
Showing 7 changed files with 27 additions and 9 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/master.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ on:
jobs:
ci_job:
name: Continous integration
runs-on: ubuntu-18.04
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: azure/setup-helm@v1
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ on:
jobs:
build_chart_job:
name: Build Helm chart
runs-on: ubuntu-18.04
runs-on: ubuntu-latest
outputs:
opalVersion: ${{ steps.opalVersion.outputs.opalVersion }}
steps:
Expand Down Expand Up @@ -49,7 +49,7 @@ jobs:

publish_chart_job:
name: Publish Helm chart
runs-on: ubuntu-18.04
runs-on: ubuntu-latest
needs: build_chart_job
steps:
- name: checkout gh-pages
Expand Down
8 changes: 8 additions & 0 deletions templates/_utils.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,14 @@
{{- end -}}
{{- end -}}

{{- define "opal.serverImage" -}}
{{- printf "%s/permitio/opal-server" .Values.image.registry }}:{{ default .Chart.AppVersion .Values.image.tag }}
{{- end -}}

{{- define "opal.clientImage" -}}
{{- printf "%s/permitio/opal-client" (default .Values.image.registry) }}:{{ default .Chart.AppVersion .Values.image.tag }}
{{- end -}}

{{- define "opal.envSecretsName" -}}
{{- if eq .Release.Name .Chart.Name }}
{{- printf "%s-env-secrets" .Release.Name }}
Expand Down
2 changes: 1 addition & 1 deletion templates/deployment-client.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ spec:
{{- end }}
containers:
- name: opal-client
image: {{ printf "%s/permitio/opal-client:%s" .Values.imageRegistry .Chart.AppVersion | quote }}
image: {{ include "opal.clientImage" . | quote }}
imagePullPolicy: IfNotPresent
ports:
- name: http
Expand Down
4 changes: 2 additions & 2 deletions templates/deployment-server.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ spec:

initContainers:
- name: git-init
image: {{ printf "%s/permitio/opal-server:%s" .Values.imageRegistry .Chart.AppVersion | quote }}
image: {{ include "opal.serverImage" . | quote }}
imagePullPolicy: IfNotPresent
volumeMounts:
- mountPath: /opt/e2e
Expand Down Expand Up @@ -61,7 +61,7 @@ spec:
{{- end }}
containers:
- name: opal-server
image: {{ printf "%s/permitio/opal-server:%s" .Values.imageRegistry .Chart.AppVersion | quote }}
image: {{ include "opal.serverImage" . | quote }}
imagePullPolicy: IfNotPresent
{{- if .Values.e2e }}
volumeMounts:
Expand Down
12 changes: 10 additions & 2 deletions values.schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,18 @@
}
},

"type": "object", "required": ["imageRegistry"],
"type": "object", "required": ["image"],

"properties": {
"imageRegistry": { "type": "string", "default": "docker.io", "title": "docker registry for all images of the chart" },
"image": {
"type": "object", "title": "image", "additionalProperties": false,
"required": ["registry"],
"properties": {
"registry": { "type": "string", "default": "docker.io", "title": "docker image registry" },
"tag": { "type": "string", "title": "docker image tag" },
"pullPolicy": { "type": "string", "default": "IfNotPresent", "title": "docker image pull policy" }
}
},
"postgresImageRegistry": { "type": "string", "default": "docker.io", "title": "docker registry for postgres image of the chart" },
"server": {
"type": ["null", "object"], "additionalProperties": false, "title": "opal server settings",
Expand Down
4 changes: 3 additions & 1 deletion values.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
imageRegistry: docker.io
image:
registry: docker.io

postgresImageRegistry: docker.io
imagePullSecrets: [ ]

Expand Down

0 comments on commit d911ab6

Please sign in to comment.