Skip to content

Commit

Permalink
Charts: add registry templating for custom airgap
Browse files Browse the repository at this point in the history
Airgap could be managed via Rancher Marketplace once we will have our
chart landing there (excluding the teal OS images).
We could anyway provide registry templating to allow separate airgap
management of the operator, seedimage-builder and channel images.

Signed-off-by: Francesco Giudici <francesco.giudici@suse.com>
  • Loading branch information
fgiudici committed Aug 23, 2023
1 parent f6e0a83 commit 742b414
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 5 deletions.
12 changes: 11 additions & 1 deletion charts/operator/templates/_helpers.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,14 @@
{{- else -}}
{{- "" -}}
{{- end -}}
{{- end -}}
{{- end -}}

{{- define "registry_url" -}}
{{- if .Values.global.cattle.systemDefaultRegistry -}}
{{ include "system_default_registry" . }}
{{- else if .Values.registry_url -}}
{{- printf "%s/" .Values.registry_url -}}
{{- else -}}
{{- "" -}}
{{- end -}}
{{- end -}}
2 changes: 1 addition & 1 deletion charts/operator/templates/channel.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,6 @@ metadata:
namespace: fleet-default
spec:
options:
image: {{ template "system_default_registry" . }}{{ .Values.channel.repository }}:{{ .Values.channel.tag }}
image: {{ template "registry_url" . }}{{ .Values.channel.repository }}:{{ .Values.channel.tag }}
type: custom
{{ end }}
6 changes: 3 additions & 3 deletions charts/operator/templates/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ spec:
{{- end }}
name: {{ .Release.Name }}
imagePullPolicy: "{{ .Values.image.imagePullPolicy }}"
image: {{ template "system_default_registry" . }}{{ .Values.image.repository }}:{{ .Values.image.tag | default .Chart.AppVersion }}
image: {{ template "registry_url" . }}{{ .Values.image.repository }}:{{ .Values.image.tag | default .Chart.AppVersion }}
args:
- operator
{{- if .Values.debug }}
Expand All @@ -34,9 +34,9 @@ spec:
- --namespace
- {{ .Release.Namespace }}
- --operator-image
- {{ template "system_default_registry" . }}{{ .Values.image.repository }}:{{ .Values.image.tag | default .Chart.AppVersion }}
- {{ template "registry_url" . }}{{ .Values.image.repository }}:{{ .Values.image.tag | default .Chart.AppVersion }}
- --seedimage-image
- {{ template "system_default_registry" . }}{{ .Values.seedImage.repository }}:{{ .Values.seedImage.tag | default .Chart.AppVersion }}
- {{ template "registry_url" . }}{{ .Values.seedImage.repository }}:{{ .Values.seedImage.tag | default .Chart.AppVersion }}
- --seedimage-image-pullpolicy
- {{ .Values.seedImage.imagePullPolicy}}
serviceAccountName: {{ .Release.Name }}
Expand Down
3 changes: 3 additions & 0 deletions charts/operator/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,9 @@ global:
cattle:
systemDefaultRegistry: ""

# used only if systemDefaultRegistry is empty
registry_url: ""

# enable debug output for operator
debug: false

Expand Down

0 comments on commit 742b414

Please sign in to comment.