diff --git a/charts/hub/quarkuscoffeeshop-pipelines/templates/_helpers.tpl b/charts/hub/quarkuscoffeeshop-pipelines/templates/_helpers.tpl new file mode 100644 index 00000000..338a4479 --- /dev/null +++ b/charts/hub/quarkuscoffeeshop-pipelines/templates/_helpers.tpl @@ -0,0 +1,12 @@ +{{/* vim: set filetype=mustache: */}} + +{{/* +Set the hostname for the imageregistry if type is openshift-internal +*/}} +{{- define "quarkuscoffeeshop-pipelines.imageRegistryHostname" -}} +{{- if (eq .Values.global.imageregistry.type "openshift-internal") -}} +registry.{{- .Values.global.hubClusterDomain -}} +{{- else }} +{{- .Values.global.imageregistry.hostname -}} +{{- end }} +{{- end }} diff --git a/charts/hub/quarkuscoffeeshop-pipelines/templates/quay-auth-secret.yaml b/charts/hub/quarkuscoffeeshop-pipelines/templates/quay-auth-secret.yaml index 0c73b9c3..a4e49363 100644 --- a/charts/hub/quarkuscoffeeshop-pipelines/templates/quay-auth-secret.yaml +++ b/charts/hub/quarkuscoffeeshop-pipelines/templates/quay-auth-secret.yaml @@ -14,7 +14,7 @@ spec: metadata: annotations: # Tekton magic, see https://tekton.dev/vault/pipelines-v0.15.2/auth/ - tekton.dev/docker-0: https://{{ .Values.global.imageregistry.hostname }} + tekton.dev/docker-0: https://{{ include "quarkuscoffeeshop-pipelines.imageRegistryHostname" . }} type: kubernetes.io/basic-auth dataFrom: - extract: diff --git a/charts/hub/quarkuscoffeeshop-pipelines/templates/tekton-pipelines/quarkuscoffeeshop-barista/pipeline/deploy-pipeline.yaml b/charts/hub/quarkuscoffeeshop-pipelines/templates/tekton-pipelines/quarkuscoffeeshop-barista/pipeline/deploy-pipeline.yaml index 3e82fc09..b8a181d0 100644 --- a/charts/hub/quarkuscoffeeshop-pipelines/templates/tekton-pipelines/quarkuscoffeeshop-barista/pipeline/deploy-pipeline.yaml +++ b/charts/hub/quarkuscoffeeshop-pipelines/templates/tekton-pipelines/quarkuscoffeeshop-barista/pipeline/deploy-pipeline.yaml @@ -10,7 +10,7 @@ spec: description: Image Tag Value name: IMAGE_TAG type: string - - default: {{ .Values.global.imageregistry.hostname }}/{{ .Values.global.imageregistry.account }}/quarkuscoffeeshop-barista + - default: {{ include "quarkuscoffeeshop-pipelines.imageRegistryHostname" . }}/{{ .Values.global.imageregistry.account }}/quarkuscoffeeshop-barista name: quay-io-repository type: string - default: latest @@ -95,7 +95,7 @@ spec: - name: srcImageURL value: "docker://image-registry.openshift-image-registry.svc:5000/quarkuscoffeeshop-cicd/quarkuscoffeeshop-barista:$(params.IMAGE_TAG)" - name: destImageURL - value: "docker://{{ .Values.global.imageregistry.hostname }}/{{ .Values.global.imageregistry.account }}/quarkuscoffeeshop-barista:$(params.IMAGE_TAG)" + value: "docker://{{ include "quarkuscoffeeshop-pipelines.imageRegistryHostname" . }}/{{ .Values.global.imageregistry.account }}/quarkuscoffeeshop-barista:$(params.IMAGE_TAG)" runAfter: - tag-test-image taskRef: diff --git a/charts/hub/quarkuscoffeeshop-pipelines/templates/tekton-pipelines/quarkuscoffeeshop-counter/pipeline/deploy-pipeline.yaml b/charts/hub/quarkuscoffeeshop-pipelines/templates/tekton-pipelines/quarkuscoffeeshop-counter/pipeline/deploy-pipeline.yaml index 635dcd02..30147c87 100644 --- a/charts/hub/quarkuscoffeeshop-pipelines/templates/tekton-pipelines/quarkuscoffeeshop-counter/pipeline/deploy-pipeline.yaml +++ b/charts/hub/quarkuscoffeeshop-pipelines/templates/tekton-pipelines/quarkuscoffeeshop-counter/pipeline/deploy-pipeline.yaml @@ -10,7 +10,7 @@ spec: description: Image Tag Value name: IMAGE_TAG type: string - - default: {{ .Values.global.imageregistry.hostname }}/{{ .Values.global.imageregistry.account }}/quarkuscoffeeshop-counter + - default: {{ include "quarkuscoffeeshop-pipelines.imageRegistryHostname" . }}/{{ .Values.global.imageregistry.account }}/quarkuscoffeeshop-counter name: quay-io-repository type: string - default: latest @@ -95,7 +95,7 @@ spec: - name: srcImageURL value: "docker://image-registry.openshift-image-registry.svc:5000/quarkuscoffeeshop-cicd/quarkuscoffeeshop-counter:$(params.IMAGE_TAG)" - name: destImageURL - value: "docker://{{ .Values.global.imageregistry.hostname }}/{{ .Values.global.imageregistry.account }}/quarkuscoffeeshop-counter:$(params.IMAGE_TAG)" + value: "docker://{{ include "quarkuscoffeeshop-pipelines.imageRegistryHostname" . }}/{{ .Values.global.imageregistry.account }}/quarkuscoffeeshop-counter:$(params.IMAGE_TAG)" runAfter: - tag-test-image taskRef: diff --git a/charts/hub/quarkuscoffeeshop-pipelines/templates/tekton-pipelines/quarkuscoffeeshop-customerloyalty/pipeline/deploy-pipeline.yaml b/charts/hub/quarkuscoffeeshop-pipelines/templates/tekton-pipelines/quarkuscoffeeshop-customerloyalty/pipeline/deploy-pipeline.yaml index fe0a028e..6f673d7e 100644 --- a/charts/hub/quarkuscoffeeshop-pipelines/templates/tekton-pipelines/quarkuscoffeeshop-customerloyalty/pipeline/deploy-pipeline.yaml +++ b/charts/hub/quarkuscoffeeshop-pipelines/templates/tekton-pipelines/quarkuscoffeeshop-customerloyalty/pipeline/deploy-pipeline.yaml @@ -10,7 +10,7 @@ spec: description: Image Tag Value name: IMAGE_TAG type: string - - default: {{ .Values.global.imageregistry.hostname }}/{{ .Values.global.imageregistry.account }}/quarkuscoffeeshop-customerloyalty + - default: {{ include "quarkuscoffeeshop-pipelines.imageRegistryHostname" . }}/{{ .Values.global.imageregistry.account }}/quarkuscoffeeshop-customerloyalty name: quay-io-repository type: string - default: latest @@ -95,7 +95,7 @@ spec: - name: srcImageURL value: "docker://image-registry.openshift-image-registry.svc:5000/quarkuscoffeeshop-cicd/quarkuscoffeeshop-customerloyalty:$(params.IMAGE_TAG)" - name: destImageURL - value: "docker://{{ .Values.global.imageregistry.hostname }}/{{ .Values.global.imageregistry.account }}/quarkuscoffeeshop-customerloyalty:$(params.IMAGE_TAG)" + value: "docker://{{ include "quarkuscoffeeshop-pipelines.imageRegistryHostname" . }}/{{ .Values.global.imageregistry.account }}/quarkuscoffeeshop-customerloyalty:$(params.IMAGE_TAG)" runAfter: - tag-test-image taskRef: diff --git a/charts/hub/quarkuscoffeeshop-pipelines/templates/tekton-pipelines/quarkuscoffeeshop-customermocker/pipeline/deploy-pipeline.yaml b/charts/hub/quarkuscoffeeshop-pipelines/templates/tekton-pipelines/quarkuscoffeeshop-customermocker/pipeline/deploy-pipeline.yaml index 66471eea..e3b56545 100644 --- a/charts/hub/quarkuscoffeeshop-pipelines/templates/tekton-pipelines/quarkuscoffeeshop-customermocker/pipeline/deploy-pipeline.yaml +++ b/charts/hub/quarkuscoffeeshop-pipelines/templates/tekton-pipelines/quarkuscoffeeshop-customermocker/pipeline/deploy-pipeline.yaml @@ -10,7 +10,7 @@ spec: description: Image Tag Value name: IMAGE_TAG type: string - - default: {{ .Values.global.imageregistry.hostname }}/{{ .Values.global.imageregistry.account }}/quarkuscoffeeshop-customermocker + - default: {{ include "quarkuscoffeeshop-pipelines.imageRegistryHostname" . }}/{{ .Values.global.imageregistry.account }}/quarkuscoffeeshop-customermocker name: quay-io-repository type: string - default: latest @@ -95,7 +95,7 @@ spec: - name: srcImageURL value: "docker://image-registry.openshift-image-registry.svc:5000/quarkuscoffeeshop-cicd/quarkuscoffeeshop-customermocker:$(params.IMAGE_TAG)" - name: destImageURL - value: "docker://{{ .Values.global.imageregistry.hostname }}/{{ .Values.global.imageregistry.account }}/quarkuscoffeeshop-customermocker:$(params.IMAGE_TAG)" + value: "docker://{{ include "quarkuscoffeeshop-pipelines.imageRegistryHostname" . }}/{{ .Values.global.imageregistry.account }}/quarkuscoffeeshop-customermocker:$(params.IMAGE_TAG)" runAfter: - tag-test-image taskRef: diff --git a/charts/hub/quarkuscoffeeshop-pipelines/templates/tekton-pipelines/quarkuscoffeeshop-inventory/pipeline/deploy-pipeline.yaml b/charts/hub/quarkuscoffeeshop-pipelines/templates/tekton-pipelines/quarkuscoffeeshop-inventory/pipeline/deploy-pipeline.yaml index 0920dd44..aa7b1a2c 100644 --- a/charts/hub/quarkuscoffeeshop-pipelines/templates/tekton-pipelines/quarkuscoffeeshop-inventory/pipeline/deploy-pipeline.yaml +++ b/charts/hub/quarkuscoffeeshop-pipelines/templates/tekton-pipelines/quarkuscoffeeshop-inventory/pipeline/deploy-pipeline.yaml @@ -10,7 +10,7 @@ spec: description: Image Tag Value name: IMAGE_TAG type: string - - default: {{ .Values.global.imageregistry.hostname }} /{{ .Values.global.imageregistry.account }}/quarkuscoffeeshop-inventory + - default: {{ include "quarkuscoffeeshop-pipelines.imageRegistryHostname" . }} /{{ .Values.global.imageregistry.account }}/quarkuscoffeeshop-inventory name: quay-io-repository type: string - default: latest @@ -95,7 +95,7 @@ spec: - name: srcImageURL value: "docker://image-registry.openshift-image-registry.svc:5000/quarkuscoffeeshop-cicd/quarkuscoffeeshop-inventory:$(params.IMAGE_TAG)" - name: destImageURL - value: "docker://{{ .Values.global.imageregistry.hostname }}/{{ .Values.global.imageregistry.account }}/quarkuscoffeeshop-inventory:$(params.IMAGE_TAG)" + value: "docker://{{ include "quarkuscoffeeshop-pipelines.imageRegistryHostname" . }}/{{ .Values.global.imageregistry.account }}/quarkuscoffeeshop-inventory:$(params.IMAGE_TAG)" runAfter: - tag-test-image taskRef: diff --git a/charts/hub/quarkuscoffeeshop-pipelines/templates/tekton-pipelines/quarkuscoffeeshop-kitchen/pipeline/deploy-pipeline.yaml b/charts/hub/quarkuscoffeeshop-pipelines/templates/tekton-pipelines/quarkuscoffeeshop-kitchen/pipeline/deploy-pipeline.yaml index dc6999f8..3504cd64 100644 --- a/charts/hub/quarkuscoffeeshop-pipelines/templates/tekton-pipelines/quarkuscoffeeshop-kitchen/pipeline/deploy-pipeline.yaml +++ b/charts/hub/quarkuscoffeeshop-pipelines/templates/tekton-pipelines/quarkuscoffeeshop-kitchen/pipeline/deploy-pipeline.yaml @@ -10,7 +10,7 @@ spec: description: Image Tag Value name: IMAGE_TAG type: string - - default: {{ .Values.global.imageregistry.hostname }}/{{ .Values.global.imageregistry.account }}/quarkuscoffeeshop-kitchen + - default: {{ include "quarkuscoffeeshop-pipelines.imageRegistryHostname" . }}/{{ .Values.global.imageregistry.account }}/quarkuscoffeeshop-kitchen name: quay-io-repository type: string - default: latest @@ -95,7 +95,7 @@ spec: - name: srcImageURL value: "docker://image-registry.openshift-image-registry.svc:5000/quarkuscoffeeshop-cicd/quarkuscoffeeshop-kitchen:$(params.IMAGE_TAG)" - name: destImageURL - value: "docker://{{ .Values.global.imageregistry.hostname }}/{{ .Values.global.imageregistry.account }}/quarkuscoffeeshop-kitchen:$(params.IMAGE_TAG)" + value: "docker://{{ include "quarkuscoffeeshop-pipelines.imageRegistryHostname" . }}/{{ .Values.global.imageregistry.account }}/quarkuscoffeeshop-kitchen:$(params.IMAGE_TAG)" runAfter: - tag-test-image taskRef: diff --git a/charts/hub/quarkuscoffeeshop-pipelines/templates/tekton-pipelines/quarkuscoffeeshop-web/pipeline/deploy-pipeline.yaml b/charts/hub/quarkuscoffeeshop-pipelines/templates/tekton-pipelines/quarkuscoffeeshop-web/pipeline/deploy-pipeline.yaml index 84ca39a3..2530e36d 100644 --- a/charts/hub/quarkuscoffeeshop-pipelines/templates/tekton-pipelines/quarkuscoffeeshop-web/pipeline/deploy-pipeline.yaml +++ b/charts/hub/quarkuscoffeeshop-pipelines/templates/tekton-pipelines/quarkuscoffeeshop-web/pipeline/deploy-pipeline.yaml @@ -10,7 +10,7 @@ spec: description: Image Tag Value name: IMAGE_TAG type: string - - default: {{ .Values.global.imageregistry.hostname }}/{{ .Values.global.imageregistry.account }}/quarkuscoffeeshop-web + - default: {{ include "quarkuscoffeeshop-pipelines.imageRegistryHostname" . }}/{{ .Values.global.imageregistry.account }}/quarkuscoffeeshop-web name: quay-io-repository type: string - default: latest @@ -95,7 +95,7 @@ spec: - name: srcImageURL value: "docker://image-registry.openshift-image-registry.svc:5000/quarkuscoffeeshop-cicd/quarkuscoffeeshop-web:$(params.IMAGE_TAG)" - name: destImageURL - value: "docker://{{ .Values.global.imageregistry.hostname }}/{{ .Values.global.imageregistry.account }}/quarkuscoffeeshop-web:$(params.IMAGE_TAG)" + value: "docker://{{ include "quarkuscoffeeshop-pipelines.imageRegistryHostname" . }}/{{ .Values.global.imageregistry.account }}/quarkuscoffeeshop-web:$(params.IMAGE_TAG)" runAfter: - tag-test-image taskRef: diff --git a/charts/store/quarkuscoffeeshop-charts/templates/_helpers.tpl b/charts/store/quarkuscoffeeshop-charts/templates/_helpers.tpl index b75e1c39..986e7de7 100644 --- a/charts/store/quarkuscoffeeshop-charts/templates/_helpers.tpl +++ b/charts/store/quarkuscoffeeshop-charts/templates/_helpers.tpl @@ -61,3 +61,14 @@ Create the name of the service account to use {{- default "default" .Values.serviceAccount.name }} {{- end }} {{- end }} + +{{/* +Set the hostname for the imageregistry if type is openshift-internal +*/}} +{{- define "quarkuscoffeeshop-charts.imageRegistryHostname" -}} +{{- if (eq .Values.global.imageregistry.type "openshift-internal") -}} +registry.{{- .Values.global.hubClusterDomain -}} +{{- else }} +{{- .Values.global.imageregistry.hostname -}} +{{- end }} +{{- end }} diff --git a/charts/store/quarkuscoffeeshop-charts/templates/deployment.yaml b/charts/store/quarkuscoffeeshop-charts/templates/deployment.yaml index af53ebc2..08286a90 100644 --- a/charts/store/quarkuscoffeeshop-charts/templates/deployment.yaml +++ b/charts/store/quarkuscoffeeshop-charts/templates/deployment.yaml @@ -25,7 +25,7 @@ spec: spec: containers: - name: quarkuscoffeeshop-barista - image: {{ .Values.global.imageregistry.hostname }}/{{ .Values.global.imageregistry.account }}/quarkuscoffeeshop-barista:{{ .Values.global.quarkuscoffeeshopBarista.imageTag }} + image: {{ include "quarkuscoffeeshop-charts.imageRegistryHostname" . }}/{{ .Values.global.imageregistry.account }}/quarkuscoffeeshop-barista:{{ .Values.global.quarkuscoffeeshopBarista.imageTag }} imagePullPolicy: {{ .Values.image.pullPolicy }} ports: - containerPort: 8778 @@ -63,7 +63,7 @@ spec: spec: containers: - name: quarkuscoffeeshop-inventory - image: {{ .Values.global.imageregistry.hostname }}/{{ .Values.global.imageregistry.account }}/quarkuscoffeeshop-inventory:{{ .Values.global.quarkuscoffeeshopInventory.imageTag }} + image: {{ include "quarkuscoffeeshop-charts.imageRegistryHostname" . }}/{{ .Values.global.imageregistry.account }}/quarkuscoffeeshop-inventory:{{ .Values.global.quarkuscoffeeshopInventory.imageTag }} imagePullPolicy: {{ .Values.image.pullPolicy }} ports: - containerPort: 8778 @@ -101,7 +101,7 @@ spec: spec: containers: - name: quarkuscoffeeshop-counter - image: {{ .Values.global.imageregistry.hostname }}/{{ .Values.global.imageregistry.account }}/quarkuscoffeeshop-counter:{{ .Values.global.quarkuscoffeeshopCounter.imageTag }} + image: {{ include "quarkuscoffeeshop-charts.imageRegistryHostname" . }}/{{ .Values.global.imageregistry.account }}/quarkuscoffeeshop-counter:{{ .Values.global.quarkuscoffeeshopCounter.imageTag }} imagePullPolicy: {{ .Values.image.pullPolicy }} ports: - containerPort: 8080 @@ -155,7 +155,7 @@ spec: spec: containers: - name: quarkuscoffeeshop-customermocker - image: {{ .Values.global.imageregistry.hostname }}/{{ .Values.global.imageregistry.account }}/quarkuscoffeeshop-customermocker:{{ .Values.global.quarkuscoffeeshopCustomermocker.imageTag }} + image: {{ include "quarkuscoffeeshop-charts.imageRegistryHostname" . }}/{{ .Values.global.imageregistry.account }}/quarkuscoffeeshop-customermocker:{{ .Values.global.quarkuscoffeeshopCustomermocker.imageTag }} imagePullPolicy: {{ .Values.image.pullPolicy }} ports: - containerPort: 8080 @@ -196,7 +196,7 @@ spec: spec: containers: - name: quarkuscoffeeshop-kitchen - image: {{ .Values.global.imageregistry.hostname }}/{{ .Values.global.imageregistry.account }}/quarkuscoffeeshop-kitchen:{{ .Values.global.quarkuscoffeeshopKitchen.imageTag }} + image: {{ include "quarkuscoffeeshop-charts.imageRegistryHostname" . }}/{{ .Values.global.imageregistry.account }}/quarkuscoffeeshop-kitchen:{{ .Values.global.quarkuscoffeeshopKitchen.imageTag }} imagePullPolicy: {{ .Values.image.pullPolicy }} ports: - containerPort: 8080 @@ -232,7 +232,7 @@ spec: spec: containers: - name: quarkuscoffeeshop-customerloyalty - image: {{ .Values.global.imageregistry.hostname }}/{{ .Values.global.imageregistry.account }}/quarkuscoffeeshop-customerloyalty:{{ .Values.global.quarkuscoffeeshopCustomerloyalty.imageTag }} + image: {{ include "quarkuscoffeeshop-charts.imageRegistryHostname" . }}/{{ .Values.global.imageregistry.account }}/quarkuscoffeeshop-customerloyalty:{{ .Values.global.quarkuscoffeeshopCustomerloyalty.imageTag }} imagePullPolicy: {{ .Values.image.pullPolicy }} ports: - containerPort: 8080 @@ -270,7 +270,7 @@ spec: spec: containers: - name: quarkuscoffeeshop-web - image: {{ .Values.global.imageregistry.hostname }}/{{ .Values.global.imageregistry.account }}/quarkuscoffeeshop-web:{{ .Values.global.quarkuscoffeeshopWeb.imageTag }} + image: {{ include "quarkuscoffeeshop-charts.imageRegistryHostname" . }}/{{ .Values.global.imageregistry.account }}/quarkuscoffeeshop-web:{{ .Values.global.quarkuscoffeeshopWeb.imageTag }} imagePullPolicy: {{ .Values.image.pullPolicy }} ports: - containerPort: 8080