Skip to content

Commit 5a6c886

Browse files
Fix app proxy deployment indentations (#21)
* fix affinity, tolerations and nodeselector for app-proxy
1 parent b767eaf commit 5a6c886

File tree

5 files changed

+149
-15
lines changed

5 files changed

+149
-15
lines changed

charts/gitops-runtime/Chart.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ apiVersion: v2
22
appVersion: v0.0.1
33
description: A Helm chart for Codefresh gitops runtime
44
name: gitops-runtime
5-
version: 0.2.0-alpha-11
5+
version: 0.2.0-alpha-12
66
home: https://github.com/codefresh-io/gitops-runtime-helm
77
keywords:
88
- codefresh

charts/gitops-runtime/README.md

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

3-
![Version: 0.2.0-alpha-11](https://img.shields.io/badge/Version-0.2.0--alpha--11-informational?style=flat-square) ![AppVersion: v0.0.1](https://img.shields.io/badge/AppVersion-v0.0.1-informational?style=flat-square)
3+
![Version: 0.2.0-alpha-12](https://img.shields.io/badge/Version-0.2.0--alpha--12-informational?style=flat-square) ![AppVersion: v0.0.1](https://img.shields.io/badge/AppVersion-v0.0.1-informational?style=flat-square)
44

55
A Helm chart for Codefresh gitops runtime
66

charts/gitops-runtime/templates/_components/cap-app-proxy/_deployment.yaml

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -78,18 +78,18 @@ spec:
7878
- mountPath: /app/config/all
7979
name: all-certs
8080
readOnly: true
81-
{{- with .Values.nodeSelector }}
82-
nodeSelector:
83-
{{- toYaml . | nindent 8 }}
84-
{{- end }}
85-
{{- with .Values.affinity }}
86-
affinity:
87-
{{- toYaml . | nindent 8 }}
88-
{{- end }}
89-
{{- with .Values.tolerations }}
90-
tolerations:
91-
{{- toYaml . | nindent 8 }}
92-
{{- end }}
81+
{{- with .Values.nodeSelector }}
82+
nodeSelector:
83+
{{- toYaml . | nindent 8 }}
84+
{{- end }}
85+
{{- with .Values.affinity }}
86+
affinity:
87+
{{- toYaml . | nindent 8}}
88+
{{- end }}
89+
{{- with .Values.tolerations }}
90+
tolerations:
91+
{{- toYaml . | nindent 6 }}
92+
{{- end }}
9393
volumes:
9494
- name: all-certs
9595
emptyDir: {}

charts/gitops-runtime/tests/app-proxy-image-enrichemnt_test.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
suite: Test integration of outputs from Argo Project templates with components that use them in the runtime chart
1+
suite: Enrichment flow related unit tests
22
templates:
33
- app-proxy/deployment.yaml
44
- app-proxy/config.yaml
Lines changed: 134 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,134 @@
1+
suite: misc tests on app-proxy templates generation
2+
templates:
3+
- app-proxy/deployment.yaml
4+
- app-proxy/config.yaml
5+
tests:
6+
- it: overriding of environment variables on main container
7+
template: 'app-proxy/deployment.yaml'
8+
values:
9+
- ./values/mandatory-values.yaml
10+
set:
11+
app-proxy.env.PORT: '8787'
12+
asserts:
13+
- contains:
14+
path: spec.template.spec.containers[0].env
15+
content:
16+
name: PORT
17+
value: 8787
18+
- it: setting security context on main container
19+
template: 'app-proxy/deployment.yaml'
20+
values:
21+
- ./values/mandatory-values.yaml
22+
set:
23+
app-proxy.securityContext.runAsUser: 1000
24+
asserts:
25+
- equal:
26+
path: spec.template.spec.containers[0].securityContext.runAsUser
27+
value: 1000
28+
- it: override readiness and liveness probes values
29+
template: 'app-proxy/deployment.yaml'
30+
values:
31+
- ./values/mandatory-values.yaml
32+
set:
33+
app-proxy.readinessProbe.initialDelaySeconds: 1
34+
app-proxy.readinessProbe.periodSeconds: 1
35+
app-proxy.readinessProbe.timeoutSeconds: 1
36+
app-proxy.readinessProbe.successThreshold: 1
37+
app-proxy.readinessProbe.failureThreshold: 1
38+
app-proxy.livenessProbe.initialDelaySeconds: 1
39+
app-proxy.livenessProbe.periodSeconds: 1
40+
app-proxy.livenessProbe.timeoutSeconds: 1
41+
app-proxy.livenessProbe.successThreshold: 1
42+
app-proxy.livenessProbe.failureThreshold: 1
43+
asserts:
44+
- equal:
45+
path: spec.template.spec.containers[0].readinessProbe.initialDelaySeconds
46+
value: 1
47+
- equal:
48+
path: spec.template.spec.containers[0].readinessProbe.periodSeconds
49+
value: 1
50+
- equal:
51+
path: spec.template.spec.containers[0].readinessProbe.timeoutSeconds
52+
value: 1
53+
- equal:
54+
path: spec.template.spec.containers[0].readinessProbe.successThreshold
55+
value: 1
56+
- equal:
57+
path: spec.template.spec.containers[0].readinessProbe.failureThreshold
58+
value: 1
59+
- equal:
60+
path: spec.template.spec.containers[0].livenessProbe.initialDelaySeconds
61+
value: 1
62+
- equal:
63+
path: spec.template.spec.containers[0].livenessProbe.periodSeconds
64+
value: 1
65+
- equal:
66+
path: spec.template.spec.containers[0].livenessProbe.timeoutSeconds
67+
value: 1
68+
- equal:
69+
path: spec.template.spec.containers[0].livenessProbe.successThreshold
70+
value: 1
71+
- equal:
72+
path: spec.template.spec.containers[0].livenessProbe.failureThreshold
73+
value: 1
74+
75+
- it: setting node selector
76+
template: 'app-proxy/deployment.yaml'
77+
values:
78+
- ./values/mandatory-values.yaml
79+
set:
80+
app-proxy.nodeSelector:
81+
test.io/node: "test"
82+
asserts:
83+
- equal:
84+
path: spec.template.spec.nodeSelector
85+
value:
86+
test.io/node: "test"
87+
88+
- it: setting tolerations
89+
template: 'app-proxy/deployment.yaml'
90+
values:
91+
- ./values/mandatory-values.yaml
92+
set:
93+
app-proxy.tolerations:
94+
- key: "arch"
95+
operator: "Equal"
96+
value: "arm64"
97+
effect: "NoSchedule"
98+
asserts:
99+
- contains:
100+
path: spec.template.spec.tolerations
101+
content:
102+
key: "arch"
103+
operator: "Equal"
104+
value: "arm64"
105+
effect: "NoSchedule"
106+
107+
- it: setting affinity
108+
template: 'app-proxy/deployment.yaml'
109+
values:
110+
- ./values/mandatory-values.yaml
111+
set:
112+
app-proxy.affinity:
113+
nodeAffinity:
114+
requiredDuringSchedulingIgnoredDuringExecution:
115+
nodeSelectorTerms:
116+
- matchExpressions:
117+
- key: topology.kubernetes.io/zone
118+
operator: In
119+
values:
120+
- antarctica-east1
121+
- antarctica-west1
122+
asserts:
123+
- equal:
124+
path: spec.template.spec.affinity
125+
value:
126+
nodeAffinity:
127+
requiredDuringSchedulingIgnoredDuringExecution:
128+
nodeSelectorTerms:
129+
- matchExpressions:
130+
- key: topology.kubernetes.io/zone
131+
operator: In
132+
values:
133+
- antarctica-east1
134+
- antarctica-west1

0 commit comments

Comments
 (0)