Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: [TKC-1851] Add registry configuration for workflows docker images #809

Merged
merged 3 commits into from
Apr 18, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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 @@ -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
17 changes: 16 additions & 1 deletion charts/testkube-api/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,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 @@ -355,6 +355,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
nicufk marked this conversation as resolved.
Show resolved Hide resolved
# -- 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: []
Comment on lines +381 to +382
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should be deleted, same as for toolkit


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