Skip to content

Commit 83f365f

Browse files
committed
Improve helm checking
Signed-off-by: Gavin Halliday <[email protected]>
1 parent bb52776 commit 83f365f

File tree

3 files changed

+238
-14
lines changed

3 files changed

+238
-14
lines changed

.github/workflows/test-helm.yml

+41-14
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,6 @@
11
name: Run helm chart tests
22

33
on:
4-
push:
5-
branches:
6-
- "master"
7-
- "candidate-*"
8-
- "!candidate-7.8.*"
9-
- "!candidate-7.6.*"
10-
- "!candidate-7.4.*"
11-
- "!candidate-7.2.*"
12-
- "!candidate-7.0.*"
13-
- "!candidate-6.*"
144
pull_request:
155
branches:
166
- "master"
@@ -57,8 +47,45 @@ jobs:
5747
- name: Check for changes in helm output for default values
5848
working-directory: .
5949
run: |
60-
helm template helm/hpcc > ${{ runner.temp }}/newoutput.txt
61-
git fetch --no-tags --prune --progress --no-recurse-submodules --depth=1 origin ${{ github.base_ref }}
50+
resultcode=0
51+
mkdir ${{ runner.temp }}/new
52+
mkdir ${{ runner.temp }}/old
53+
54+
#Generate the output for the default values file, and each of the specialised test files.
55+
#Check to see if anything has changed between old and new, and report the differences
56+
helm template helm/hpcc > ${{ runner.temp }}/new/output.txt
57+
for file in testing/helm/tests/*.yaml
58+
do
59+
tail=$(basename $file)
60+
helm template helm/hpcc --values $file > ${{ runner.temp }}/new/$tail.txt
61+
done
62+
63+
git fetch --no-tags --prune --progress --no-recurse-submodules --quiet --depth=1 origin ${{ github.base_ref }}
64+
echo git checkout ${{ github.base_ref }}
6265
git checkout ${{ github.base_ref }}
63-
helm template helm/hpcc > ${{ runner.temp }}/oldoutput.txt
64-
diff ${{ runner.temp }}/oldoutput.txt ${{ runner.temp }}/newoutput.txt
66+
67+
helm template helm/hpcc > ${{ runner.temp }}/old/output.txt
68+
for file in testing/helm/tests/*.yaml
69+
do
70+
tail=$(basename $file)
71+
helm template helm/hpcc --values $file > ${{ runner.temp }}/old/$tail.txt
72+
done
73+
74+
diff ${{ runner.temp }}/old/output.txt ${{ runner.temp }}/new/output.txt
75+
if [ $? -ne 0 ]
76+
then
77+
resultcode=1
78+
else
79+
#Only check for differences in the specialised test files if the default values file is the same
80+
for file in testing/helm/tests/*.yaml
81+
do
82+
tail=$(basename $file)
83+
diff ${{ runner.temp }}/old/$tail.txt ${{ runner.temp }}/new/$tail.txt
84+
if [ $? -ne 0 ]
85+
then
86+
resultcode=1
87+
fi
88+
done
89+
fi
90+
91+
exit $resultcode

testing/helm/tests/values-hpcc1.yaml

+98
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,98 @@
1+
global:
2+
privileged: true
3+
egress:
4+
restricted: false
5+
certificates:
6+
issuers:
7+
remote:
8+
name: hpcc-remote-issuer
9+
domain: hpcc1
10+
## set enabled to true if adding remoteClients for any components
11+
enabled: true
12+
## kind can be changed to ClusterIssue to refer to a ClusterIssuer. https://cert-manager.io/docs/reference/api-docs/#cert-manager.io/v1.ClusterIssuer
13+
kind: Issuer
14+
spiffe: false
15+
## do not define spec (set spec: null), to reference an Issuer resource that already exists in the cluster
16+
## change spec if you'd like to change how certificates get issued... see ## https://cert-manager.io/docs/configuration/#supported-issuer-types
17+
## for information on what spec should contain.
18+
spec:
19+
ca: null
20+
vault:
21+
path: pki/sign/hpccremote
22+
server: http://vault.vaultns:8200
23+
auth:
24+
tokenSecretRef:
25+
name: cert-manager-vault-token
26+
key: token
27+
28+
signing: # intended to be used for signing/verification purposes only, e.g. by dafilesrv
29+
name: hpcc-signing-issuer
30+
## kind can be changed to ClusterIssue to refer to a ClusterIssuer. https://cert-manager.io/docs/reference/api-docs/#cert-manager.io/v1.ClusterIssuer
31+
kind: Issuer
32+
## do not define spec (set spec: null), to reference an Issuer resource that already exists in the cluster
33+
## change spec if you'd like to change how certificates get issued... see ## https://cert-manager.io/docs/configuration/#supported-issuer-types
34+
## for information on what spec should contain.
35+
spec:
36+
ca:
37+
secretName: hpcc-signing-issuer-key-pair
38+
39+
thor: null
40+
eclagent: null
41+
eclscheduler: null
42+
dafilesrv: null
43+
dfuserver: null
44+
45+
sasha:
46+
disabled: true
47+
wu-archiver:
48+
disabled: true
49+
dfuwu-archiver:
50+
disabled: true
51+
dfurecovery-archiver:
52+
disabled: true
53+
file-expiry:
54+
disabled: true
55+
56+
esp:
57+
- name: eclwatch
58+
application: eclwatch
59+
auth: none
60+
replicas: 1
61+
service:
62+
port: 8888
63+
servicePort: 18010
64+
visibility: local
65+
- name: eclqueries
66+
application: eclqueries
67+
auth: none
68+
replicas: 1
69+
service:
70+
visibility: local
71+
servicePort: 18002
72+
- name: eclservices
73+
application: eclservices
74+
auth: none
75+
replicas: 1
76+
service:
77+
servicePort: 8010
78+
visibility: cluster
79+
80+
roxie:
81+
- name: roxie1
82+
disabled: false
83+
prefix: roxie1
84+
services:
85+
- name: roxie1
86+
servicePort: 19876
87+
listenQueue: 200
88+
numThreads: 30
89+
visibility: local
90+
trustClients:
91+
- commonName: roxie2.hpcc2
92+
replicas: 1
93+
numChannels: 1
94+
serverReplicas: 0
95+
localAgent: false
96+
traceLevel: 1
97+
topoServer:
98+
replicas: 1

testing/helm/tests/values-hpcc2.yaml

+99
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,99 @@
1+
global:
2+
privileged: true
3+
egress:
4+
restricted: false
5+
certificates:
6+
issuers:
7+
remote:
8+
name: hpcc-remote-issuer
9+
domain: hpcc2
10+
## set enabled to true if adding remoteClients for any components
11+
enabled: true
12+
## kind can be changed to ClusterIssue to refer to a ClusterIssuer. https://cert-manager.io/docs/reference/api-docs/#cert-manager.io/v1.ClusterIssuer
13+
kind: Issuer
14+
spiffe: false
15+
## do not define spec (set spec: null), to reference an Issuer resource that already exists in the cluster
16+
## change spec if you'd like to change how certificates get issued... see ## https://cert-manager.io/docs/configuration/#supported-issuer-types
17+
## for information on what spec should contain.
18+
spec:
19+
ca: null
20+
vault:
21+
path: pki/sign/hpccremote
22+
server: http://vault.vaultns:8200
23+
auth:
24+
tokenSecretRef:
25+
name: cert-manager-vault-token
26+
key: token
27+
28+
signing: # intended to be used for signing/verification purposes only, e.g. by dafilesrv
29+
name: hpcc-signing-issuer
30+
## kind can be changed to ClusterIssue to refer to a ClusterIssuer. https://cert-manager.io/docs/reference/api-docs/#cert-manager.io/v1.ClusterIssuer
31+
kind: Issuer
32+
## do not define spec (set spec: null), to reference an Issuer resource that already exists in the cluster
33+
## change spec if you'd like to change how certificates get issued... see ## https://cert-manager.io/docs/configuration/#supported-issuer-types
34+
## for information on what spec should contain.
35+
spec:
36+
ca:
37+
secretName: hpcc-signing-issuer-key-pair
38+
39+
thor: null
40+
eclagent: null
41+
eclscheduler: null
42+
dafilesrv: null
43+
dfuserver: null
44+
45+
sasha:
46+
disabled: true
47+
wu-archiver:
48+
disabled: true
49+
dfuwu-archiver:
50+
disabled: true
51+
dfurecovery-archiver:
52+
disabled: true
53+
file-expiry:
54+
disabled: true
55+
56+
esp:
57+
- name: eclwatch
58+
application: eclwatch
59+
auth: none
60+
replicas: 1
61+
service:
62+
port: 8888
63+
servicePort: 28010
64+
visibility: local
65+
- name: eclqueries
66+
application: eclqueries
67+
auth: none
68+
replicas: 1
69+
service:
70+
visibility: local
71+
servicePort: 28002
72+
- name: eclservices
73+
application: eclservices
74+
auth: none
75+
replicas: 1
76+
service:
77+
servicePort: 8010
78+
visibility: cluster
79+
80+
roxie:
81+
- name: roxie2
82+
disabled: false
83+
prefix: roxie2
84+
services:
85+
- name: roxie2
86+
servicePort: 29876
87+
listenQueue: 200
88+
numThreads: 30
89+
visibility: local
90+
trustClients:
91+
- commonName: roxie1.hpcc1
92+
replicas: 1
93+
numChannels: 1
94+
serverReplicas: 0
95+
localAgent: false
96+
singleNode: false
97+
traceLevel: 1
98+
topoServer:
99+
replicas: 1

0 commit comments

Comments
 (0)