Skip to content

Commit d8f5e4a

Browse files
fix: imageRegistry in runtime spec (#390)
1 parent 132c333 commit d8f5e4a

File tree

5 files changed

+193
-19
lines changed

5 files changed

+193
-19
lines changed

charts/cf-runtime/Chart.yaml

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
apiVersion: v2
22
description: A Helm chart for Codefresh Runner
33
name: cf-runtime
4-
version: 6.0.0
4+
version: 6.0.1
55
keywords:
66
- codefresh
77
- runner
@@ -14,12 +14,8 @@ maintainers:
1414
url: https://codefresh-io.github.io/
1515
annotations:
1616
artifacthub.io/changes: |
17-
- kind: deprecated
18-
description: Deprecated --generate-helm-values-file
19-
- kind: changed
20-
description: Update engine version
21-
- kind: changed
22-
description: Update dind version
17+
- kind: fixed
18+
description: Fix imageRegistry prefix for runtime images
2319
dependencies:
2420
- name: cf-common
2521
repository: https://chartmuseum.codefresh.io/cf-common

charts/cf-runtime/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
## Codefresh Runner
22

3-
![Version: 6.0.0](https://img.shields.io/badge/Version-6.0.0-informational?style=flat-square)
3+
![Version: 6.0.1](https://img.shields.io/badge/Version-6.0.1-informational?style=flat-square)
44

55
Helm chart for deploying [Codefresh Runner](https://codefresh.io/docs/docs/installation/codefresh-runner/) to Kubernetes.
66

charts/cf-runtime/templates/runtime/runtime-env-spec-tmpl.yaml

Lines changed: 12 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
{{- $name := (include "runtime.runtime-environment-spec.runtime-name" .) -}}
55
{{- $engineContext := .Values.runtime.engine -}}
66
{{- $dindContext := .Values.runtime.dind -}}
7+
{{- $imageRegistry := .Values.global.imageRegistry -}}
78
metadata:
89
name: {{ include "runtime.runtime-environment-spec.runtime-name" . }}
910
agent: {{ .Values.runtime.agent }}
@@ -26,17 +27,17 @@ runtimeScheduler:
2627
{{- with $engineContext.env }}
2728
{{- toYaml . | nindent 4 }}
2829
{{- end }}
29-
COMPOSE_IMAGE: '{{ include "runtime.runtimeImageName" (dict "registry" .Values.global.imageRegisty "imageFullName" $engineContext.runtimeImages.COMPOSE_IMAGE) }}'
30-
CONTAINER_LOGGER_IMAGE: '{{ include "runtime.runtimeImageName" (dict "registry" .Values.global.imageRegisty "imageFullName" $engineContext.runtimeImages.CONTAINER_LOGGER_IMAGE) }}'
31-
DOCKER_BUILDER_IMAGE: '{{ include "runtime.runtimeImageName" (dict "registry" .Values.global.imageRegisty "imageFullName" $engineContext.runtimeImages.DOCKER_BUILDER_IMAGE) }}'
32-
DOCKER_PULLER_IMAGE: '{{ include "runtime.runtimeImageName" (dict "registry" .Values.global.imageRegisty "imageFullName" $engineContext.runtimeImages.DOCKER_PULLER_IMAGE) }}'
33-
DOCKER_PUSHER_IMAGE: '{{ include "runtime.runtimeImageName" (dict "registry" .Values.global.imageRegisty "imageFullName" $engineContext.runtimeImages.DOCKER_PUSHER_IMAGE) }}'
34-
DOCKER_TAG_PUSHER_IMAGE: '{{ include "runtime.runtimeImageName" (dict "registry" .Values.global.imageRegisty "imageFullName" $engineContext.runtimeImages.DOCKER_TAG_PUSHER_IMAGE) }}'
35-
FS_OPS_IMAGE: '{{ include "runtime.runtimeImageName" (dict "registry" .Values.global.imageRegisty "imageFullName" $engineContext.runtimeImages.FS_OPS_IMAGE) }}'
36-
GIT_CLONE_IMAGE: '{{ include "runtime.runtimeImageName" (dict "registry" .Values.global.imageRegisty "imageFullName" $engineContext.runtimeImages.GIT_CLONE_IMAGE) }}'
37-
KUBE_DEPLOY: '{{ include "runtime.runtimeImageName" (dict "registry" .Values.global.imageRegisty "imageFullName" $engineContext.runtimeImages.KUBE_DEPLOY) }}'
38-
PIPELINE_DEBUGGER_IMAGE: '{{ include "runtime.runtimeImageName" (dict "registry" .Values.global.imageRegisty "imageFullName" $engineContext.runtimeImages.PIPELINE_DEBUGGER_IMAGE) }}'
39-
TEMPLATE_ENGINE: '{{ include "runtime.runtimeImageName" (dict "registry" .Values.global.imageRegisty "imageFullName" $engineContext.runtimeImages.TEMPLATE_ENGINE) }}'
30+
COMPOSE_IMAGE: '{{ include "runtime.runtimeImageName" (dict "registry" $imageRegistry "imageFullName" $engineContext.runtimeImages.COMPOSE_IMAGE) }}'
31+
CONTAINER_LOGGER_IMAGE: '{{ include "runtime.runtimeImageName" (dict "registry" $imageRegistry "imageFullName" $engineContext.runtimeImages.CONTAINER_LOGGER_IMAGE) }}'
32+
DOCKER_BUILDER_IMAGE: '{{ include "runtime.runtimeImageName" (dict "registry" $imageRegistry "imageFullName" $engineContext.runtimeImages.DOCKER_BUILDER_IMAGE) }}'
33+
DOCKER_PULLER_IMAGE: '{{ include "runtime.runtimeImageName" (dict "registry" $imageRegistry "imageFullName" $engineContext.runtimeImages.DOCKER_PULLER_IMAGE) }}'
34+
DOCKER_PUSHER_IMAGE: '{{ include "runtime.runtimeImageName" (dict "registry" $imageRegistry "imageFullName" $engineContext.runtimeImages.DOCKER_PUSHER_IMAGE) }}'
35+
DOCKER_TAG_PUSHER_IMAGE: '{{ include "runtime.runtimeImageName" (dict "registry" $imageRegistry "imageFullName" $engineContext.runtimeImages.DOCKER_TAG_PUSHER_IMAGE) }}'
36+
FS_OPS_IMAGE: '{{ include "runtime.runtimeImageName" (dict "registry" $imageRegistry "imageFullName" $engineContext.runtimeImages.FS_OPS_IMAGE) }}'
37+
GIT_CLONE_IMAGE: '{{ include "runtime.runtimeImageName" (dict "registry" $imageRegistry "imageFullName" $engineContext.runtimeImages.GIT_CLONE_IMAGE) }}'
38+
KUBE_DEPLOY: '{{ include "runtime.runtimeImageName" (dict "registry" $imageRegistry "imageFullName" $engineContext.runtimeImages.KUBE_DEPLOY) }}'
39+
PIPELINE_DEBUGGER_IMAGE: '{{ include "runtime.runtimeImageName" (dict "registry" $imageRegistry "imageFullName" $engineContext.runtimeImages.PIPELINE_DEBUGGER_IMAGE) }}'
40+
TEMPLATE_ENGINE: '{{ include "runtime.runtimeImageName" (dict "registry" $imageRegistry "imageFullName" $engineContext.runtimeImages.TEMPLATE_ENGINE) }}'
4041
{{- with $engineContext.userEnvVars }}
4142
userEnvVars: {{- toYaml . | nindent 2 }}
4243
{{- end }}
Lines changed: 153 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,153 @@
1+
# yaml-language-server: $schema=https://raw.githubusercontent.com/quintush/helm-unittest/master/schema/helm-testsuite.json
2+
suite: private_registry test
3+
values:
4+
- ../values.yaml
5+
- ../values-private-registry.yaml
6+
templates:
7+
- templates/hooks/post-install/cm-update-runtime.yaml
8+
- templates/runner/deployment.yaml
9+
- templates/volume-provisioner/deployment.yaml
10+
- templates/volume-provisioner/daemonset.yaml
11+
- templates/volume-provisioner/cronjob.yaml
12+
- templates/monitor/deployment.yaml
13+
- templates/app-proxy/deployment.yaml
14+
release:
15+
name: cf-runtime
16+
namespace: codefresh
17+
revision: 1
18+
upgrade: true
19+
chart:
20+
version: 1.0.0
21+
appVersion: 1.0.0
22+
tests:
23+
- it: Test private registry in runtime spec
24+
template: templates/hooks/post-install/cm-update-runtime.yaml
25+
asserts:
26+
- equal:
27+
path: data["runtime.yaml"]
28+
value: |-
29+
metadata:
30+
name: my-context/codefresh
31+
agent: true
32+
extends:
33+
- system/default/hybrid/k8s_low_limits
34+
runtimeScheduler:
35+
type: KubernetesPod
36+
image: somedomain.io/codefresh/engine:tagoverride
37+
command:
38+
- npm
39+
- run
40+
- start
41+
envVars:
42+
COMPOSE_IMAGE: 'somedomain.io/codefresh/compose:tagoverride'
43+
CONTAINER_LOGGER_IMAGE: 'somedomain.io/codefresh/cf-container-logger:tagoverride'
44+
DOCKER_BUILDER_IMAGE: 'somedomain.io/codefresh/cf-docker-builder:tagoverride'
45+
DOCKER_PULLER_IMAGE: 'somedomain.io/codefresh/cf-docker-puller:tagoverride'
46+
DOCKER_PUSHER_IMAGE: 'somedomain.io/codefresh/cf-docker-pusher:tagoverride'
47+
DOCKER_TAG_PUSHER_IMAGE: 'somedomain.io/codefresh/cf-docker-tag-pusher:tagoverride'
48+
FS_OPS_IMAGE: 'somedomain.io/codefresh/fs-ops:tagoverride'
49+
GIT_CLONE_IMAGE: 'somedomain.io/codefresh/cf-git-cloner:tagoverride'
50+
KUBE_DEPLOY: 'somedomain.io/codefresh/cf-deploy-kubernetes:tagoverride'
51+
PIPELINE_DEBUGGER_IMAGE: 'somedomain.io/codefresh/cf-debugger:tagoverride'
52+
TEMPLATE_ENGINE: 'somedomain.io/codefresh/pikolo:tagoverride'
53+
cluster:
54+
namespace: codefresh
55+
serviceAccount: codefresh-engine
56+
clusterProvider:
57+
accountId: 7890
58+
selector: my-context
59+
resources:
60+
limits:
61+
cpu: 1000m
62+
memory: 2048Mi
63+
requests:
64+
cpu: 100m
65+
memory: 128Mi
66+
dockerDaemonScheduler:
67+
type: DindKubernetesPod
68+
dindImage: somedomain.io/codefresh/dind:tagoverride
69+
userAccess: true
70+
cluster:
71+
namespace: codefresh
72+
serviceAccount: codefresh-engine
73+
clusterProvider:
74+
accountId: 7890
75+
selector: my-context
76+
pvcs:
77+
- name: dind
78+
reuseVolumeSelector: codefresh-app,io.codefresh.accountName
79+
reuseVolumeSortOrder: pipeline_id
80+
storageClassName: 'dind-local-volumes-runner-codefresh'
81+
volumeSize: 16Gi
82+
defaultDindResources:
83+
limits:
84+
cpu: 400m
85+
memory: 800Mi
86+
requests: null
87+
88+
- it: Test private registy in runner
89+
template: templates/runner/deployment.yaml
90+
asserts:
91+
- matchRegex:
92+
path: spec.template.spec.containers[0].image
93+
pattern: ^somedomain.io/codefresh/.*$
94+
95+
- it: Test private registy in runner init container
96+
template: templates/runner/deployment.yaml
97+
asserts:
98+
- matchRegex:
99+
path: spec.template.spec.initContainers[0].image
100+
pattern: ^somedomain.io/codefresh/.*$
101+
102+
- it: Test private registy in volume-provisioner
103+
template: templates/runner/deployment.yaml
104+
asserts:
105+
- matchRegex:
106+
path: spec.template.spec.containers[0].image
107+
pattern: ^somedomain.io/codefresh/.*$
108+
109+
- it: Test private registy in dind-lv-monitor
110+
template: templates/volume-provisioner/daemonset.yaml
111+
asserts:
112+
- matchRegex:
113+
path: spec.template.spec.containers[0].image
114+
pattern: ^somedomain.io/codefresh/.*$
115+
116+
- it: Test private registy in cronjob
117+
template: templates/volume-provisioner/cronjob.yaml
118+
set:
119+
storage.backend: ebs-csi
120+
asserts:
121+
- matchRegex:
122+
path: spec.jobTemplate.spec.template.spec.containers[0].image
123+
pattern: ^somedomain.io/codefresh/.*$
124+
125+
- it: Test private registy in monitor
126+
template: templates/monitor/deployment.yaml
127+
set:
128+
monitor.enabled: true
129+
asserts:
130+
- matchRegex:
131+
path: spec.template.spec.containers[0].image
132+
pattern: ^somedomain.io/codefresh/.*$
133+
134+
- it: Test private registy in app-proxy
135+
template: templates/app-proxy/deployment.yaml
136+
set:
137+
appProxy.enabled: true
138+
asserts:
139+
- matchRegex:
140+
path: spec.template.spec.containers[0].image
141+
pattern: ^somedomain.io/codefresh/.*$
142+
143+
- it: Test private registy in hooks
144+
asserts:
145+
- matchRegex:
146+
path: spec.template.spec.containers[0].image
147+
pattern: ^somedomain.io/codefresh/.*$
148+
template: templates/hooks/post-install/job-update-runtime.yaml
149+
- matchRegex:
150+
path: spec.template.spec.containers[0].image
151+
pattern: ^somedomain.io/codefresh/.*$
152+
template: templates/hooks/post-install/job-gencerts-dind.yaml
153+
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
global:
2+
imageRegistry: somedomain.io
3+
4+
runtime:
5+
# just locking tags for unit test
6+
engine:
7+
image:
8+
tag: tagoverride
9+
runtimeImages:
10+
COMPOSE_IMAGE: quay.io/codefresh/compose:tagoverride
11+
CONTAINER_LOGGER_IMAGE: quay.io/codefresh/cf-container-logger:tagoverride
12+
DOCKER_BUILDER_IMAGE: quay.io/codefresh/cf-docker-builder:tagoverride
13+
DOCKER_PULLER_IMAGE: quay.io/codefresh/cf-docker-puller:tagoverride
14+
DOCKER_PUSHER_IMAGE: quay.io/codefresh/cf-docker-pusher:tagoverride
15+
DOCKER_TAG_PUSHER_IMAGE: quay.io/codefresh/cf-docker-tag-pusher:tagoverride
16+
FS_OPS_IMAGE: quay.io/codefresh/fs-ops:tagoverride
17+
GIT_CLONE_IMAGE: quay.io/codefresh/cf-git-cloner:tagoverride
18+
KUBE_DEPLOY: quay.io/codefresh/cf-deploy-kubernetes:tagoverride
19+
PIPELINE_DEBUGGER_IMAGE: quay.io/codefresh/cf-debugger:tagoverride
20+
TEMPLATE_ENGINE: quay.io/codefresh/pikolo:tagoverride
21+
22+
dind:
23+
image:
24+
tag: tagoverride

0 commit comments

Comments
 (0)