Skip to content

Commit 1ed1dae

Browse files
committed
added logic to define the image type as public or private
1 parent a73cc74 commit 1ed1dae

File tree

2 files changed

+31
-6
lines changed

2 files changed

+31
-6
lines changed

varnish-enterprise/templates/_helpers.tpl

Lines changed: 24 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -35,12 +35,31 @@ Create chart name and version as used by the chart label.
3535
{{/*
3636
Sets up the Varnish Enterprise image and its overrides (if any)
3737
*/}}
38-
{{- define "varnish-enterprise.image" }}
39-
{{- $base := .base | default dict }}
40-
{{- $image := .image | default dict }}
41-
image: "{{- if eq $image.repository "-" -}}{{ $base.repository }}{{ else }}{{ $image.repository }}{{ end }}:{{- if eq $image.tag "-" }}{{ default .Chart.AppVersion $base.tag }}{{ else }}{{ default $.Chart.AppVersion $image.tag }}{{ end }}"
38+
{{- define "varnish-enterprise.image" -}}
39+
{{- $base := .base | default dict -}}
40+
{{- $image := .image | default dict -}}
41+
42+
{{- $repoType := .Values.global.repoType | default "" -}}
43+
{{- $calculatedRepo := $base.repository -}}
44+
45+
{{- if eq $repoType "public-enterprise" }}
46+
{{- $calculatedRepo = "varnish/enterprise" }}
47+
{{- else if eq $repoType "private-enterprise" }}
48+
{{- $calculatedRepo = "quay.io/varnish-software/varnish-plus" }}
49+
{{ end }}
50+
image: "{{- if eq $image.repository "-" -}}
51+
{{ $calculatedRepo }}
52+
{{- else -}}
53+
{{ $image.repository }} y
54+
{{- end -}}
55+
:
56+
{{- if eq $image.tag "-" }}
57+
{{ default .Chart.AppVersion $base.tag }}
58+
{{- else -}}
59+
{{ default $.Chart.AppVersion $image.tag }}
60+
{{- end -}}"
4261
imagePullPolicy: {{ if eq $image.pullPolicy "-" }}{{ $base.pullPolicy }}{{ else }}{{ $image.pullPolicy }}{{ end }}
43-
{{- end }}
62+
{{- end -}}
4463

4564
{{/*
4665
Converts size string (e.g. 10Mi or 10M) to a number

varnish-enterprise/values.yaml

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,9 @@ global:
7070
# Configures the NATS internal cluster domain name. Only change if NATS is deployed
7171
# on a separate cluster.
7272
clusterDomain: "cluster.local"
73+
74+
# Sets the option of a different repo than the quay.io image
75+
repoType: "private-enterprise"
7376

7477
serviceAccount:
7578
# Specifies whether a service account should be created
@@ -544,7 +547,7 @@ server:
544547
# Sets the image and tag to use to deploy Varnish Enterprise.
545548
# If tag is blank, appVersion is used.
546549
image:
547-
repository: "quay.io/varnish-software/varnish-plus"
550+
repository: "-"
548551
pullPolicy: IfNotPresent
549552
tag: ""
550553

@@ -909,6 +912,9 @@ server:
909912
agent:
910913
enabled: false
911914

915+
# Sets the option of a different repo than the quay.io image below.
916+
# repoType: "private-enterprise"
917+
912918
# Sets the image and tag to use to deploy Varnish Controller Agent sidecar. The image
913919
# should be the same version as varnish-controller.
914920
image:

0 commit comments

Comments
 (0)