Skip to content

Commit

Permalink
fix: add registry configuration for workflows doecker images
Browse files Browse the repository at this point in the history
  • Loading branch information
nicufk committed Apr 16, 2024
1 parent 8e9f410 commit 23e2360
Show file tree
Hide file tree
Showing 4 changed files with 79 additions and 0 deletions.
47 changes: 47 additions & 0 deletions charts/testkube-api/templates/_helpers.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,53 @@ Define API image
{{- end -}}
{{- end -}}

{{/*
Define Test Workflows Toolkit Image
*/}}
{{- define "testkube-tw-toolkit.image" -}}
{{- $registryName := .Values.imageWorkflows.registry -}}
{{- $repositoryName := .Values.imageWorkflows.repositoryToolkit -}}
{{- $tag := default .Chart.AppVersion .Values.imageWorkflows.tag | toString -}}
{{- $separator := ":" -}}
{{- if .Values.imageWorkflows.digest }}
{{- $separator = "@" -}}
{{- $tag = .Values.imageWorkflows.digest | toString -}}
{{- end -}}
{{- if .Values.global }}
{{- if .Values.global.imageRegistry }}
{{- printf "%s/%s%s%s" .Values.global.imageRegistry $repositoryName $separator $tag -}}
{{- else -}}
{{- printf "%s/%s%s%s" $registryName $repositoryName $separator $tag -}}
{{- end -}}
{{- else -}}
{{- printf "%s/%s%s%s" $registryName $repositoryName $separator $tag -}}
{{- end -}}
{{- end -}}


{{/*
Define Test Workflows Init Image
*/}}
{{- define "testkube-tw-init.image" -}}
{{- $registryName := .Values.imageWorkflows.registry -}}
{{- $repositoryName := .Values.imageWorkflows.repositoryInit -}}
{{- $tag := default .Chart.AppVersion .Values.imageWorkflows.tag | toString -}}
{{- $separator := ":" -}}
{{- if .Values.imageWorkflows.digest }}
{{- $separator = "@" -}}
{{- $tag = .Values.imageWorkflows.digest | toString -}}
{{- end -}}
{{- if .Values.global }}
{{- if .Values.global.imageRegistry }}
{{- printf "%s/%s%s%s" .Values.global.imageRegistry $repositoryName $separator $tag -}}
{{- else -}}
{{- printf "%s/%s%s%s" $registryName $repositoryName $separator $tag -}}
{{- end -}}
{{- else -}}
{{- printf "%s/%s%s%s" $registryName $repositoryName $separator $tag -}}
{{- end -}}
{{- end -}}

{{/*
Define TESTKUBE_WATCHER_NAMESPACES variable
*/}}
Expand Down
4 changes: 4 additions & 0 deletions charts/testkube-api/templates/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -414,6 +414,10 @@ spec:
{{- end }}
- name: TESTKUBE_DEFAULT_STORAGE_CLASS_NAME
value: "{{ .Values.defaultStorageClassName }}"
- name: TESTKUBE_TW_TOOLKIT_IMAGE
value: "{{ include "testkube-tw-toolkit.image" . }}"
- name: TESTKUBE_TW_INIT_IMAGE
value: "{{ include "testkube-tw-init.image" . }}"
image: {{ include "testkube-api.image" . }}
imagePullPolicy: {{ .Values.image.pullPolicy }}
ports:
Expand Down
10 changes: 10 additions & 0 deletions charts/testkube-api/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,16 @@ image:
digest: ""
pullSecret: []

imageWorkflows:
registry: docker.io
repositoryToolkit: kubeshop/testkube-tw-toolkit
repositoryInit: kubeshop/testkube-tw-init
pullPolicy: IfNotPresent
## Overrides the image tag whose default is the chart appVersion.
# tag: "1.7.24"
digest: ""
pullSecret: []

## Chart parameters
## nameOverride Overrides Chart name
## fullnameOverride Full name that overrides Chart name
Expand Down
18 changes: 18 additions & 0 deletions charts/testkube/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -355,6 +355,24 @@ testkube-api:
digest: ""
# -- Testkube API k8s secret for private registries
pullSecrets: []

# Test Workflows image parameters
imageWorkflows:
# -- Test Workflows image registry
registry: docker.io
# -- Test Workflows image name
repositoryToolkit: kubeshop/testkube-tw-toolkit
# -- Test Workflows init image name
repositoryInit: kubeshop/testkube-tw-init
# Overrides the image tag whose default is the chart appVersion.
# tag: "latest"
# -- Test Workflows image tag
pullPolicy: IfNotPresent
# -- Test Workflows image digest in the way sha256:aa.... Please note this parameter, if set, will override the tag
digest: ""
# -- Test Workflows image k8s secret for private registries
pullSecrets: []

# -- Extra environment variables to be set on deployment
extraEnvVars: []
# - name: FOO
Expand Down

0 comments on commit 23e2360

Please sign in to comment.