Skip to content

Commit

Permalink
fix: [TKC-1851] Add registry configuration for workflows docker images (
Browse files Browse the repository at this point in the history
#809) (#814)

* fix: add registry configuration for workflows doecker images

* fix: image tags

* fix: remove pullSecrets
  • Loading branch information
nicufk authored Apr 18, 2024
1 parent ac84743 commit 87e140a
Show file tree
Hide file tree
Showing 4 changed files with 93 additions and 1 deletion.
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.imageTwToolkit.registry -}}
{{- $repositoryName := .Values.imageTwToolkit.repository -}}
{{- $tag := default .Chart.AppVersion (default .Values.image.tag .Values.imageTwToolkit.tag) | toString -}}
{{- $separator := ":" -}}
{{- if .Values.imageTwToolkit.digest }}
{{- $separator = "@" -}}
{{- $tag = .Values.imageTwToolkit.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.imageTwInit.registry -}}
{{- $repositoryName := .Values.imageTwInit.repository -}}
{{- $tag := default .Chart.AppVersion (default .Values.image.tag .Values.imageTwInit.tag) | toString -}}
{{- $separator := ":" -}}
{{- if .Values.imageTwInit.digest }}
{{- $separator = "@" -}}
{{- $tag = .Values.imageTwInit.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 @@ -408,6 +408,10 @@ spec:
- name: TESTKUBE_PRO_RUNNER_CUSTOM_CA_SECRET
value: {{ .Values.cloud.tls.customCaSecretRef }}
{{- end }}
- 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
17 changes: 16 additions & 1 deletion charts/testkube-api/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,22 @@ image:
## Overrides the image tag whose default is the chart appVersion.
# tag: "1.7.24"
digest: ""
pullSecret: []
pullSecrets: []

imageTwToolkit:
registry: docker.io
repository: kubeshop/testkube-tw-toolkit
## Overrides the image tag whose default is the api-server version.
# tag: "1.7.24"
digest: ""


imageTwInit:
registry: docker.io
repository: kubeshop/testkube-tw-init
## Overrides the image tag whose default is the api-server version.
# tag: "1.7.24"
digest: ""

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

# Test Workflows toolkit image parameters
imageTwToolkit:
# -- Test Workflows image registry
registry: docker.io
# -- Test Workflows image name
repository: kubeshop/testkube-tw-toolkit
# Overrides the image tag whose default is the chart appVersion.
# tag: "latest"
# -- Test Workflows image digest in the way sha256:aa.... Please note this parameter, if set, will override the tag
digest: ""


# Test Workflows init image parameters
imageTwInit:
# -- Test Workflows image registry
registry: docker.io
# -- Test Workflows image name
repository: kubeshop/testkube-tw-init
# Overrides the image tag whose default is the chart appVersion.
# tag: "latest"
# -- 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 87e140a

Please sign in to comment.