Skip to content

Commit 228e4b8

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

File tree

2 files changed

+49
-7
lines changed

2 files changed

+49
-7
lines changed

.github/workflows/test-helm.yml

+48-6
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ jobs:
3838
name: "Check helm chart lint"
3939
runs-on: ubuntu-20.04
4040
needs: pre_job
41-
if: ${{ github.repository == 'hpcc-systems/HPCC-Platform' && needs.pre_job.outputs.helm }}
41+
#if: ${{ github.repository == 'hpcc-systems/HPCC-Platform' && needs.pre_job.outputs.helm }}
4242
steps:
4343
- uses: actions/checkout@v4
4444
with:
@@ -57,8 +57,50 @@ jobs:
5757
- name: Check for changes in helm output for default values
5858
working-directory: .
5959
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 }}
62-
git checkout ${{ github.base_ref }}
63-
helm template helm/hpcc > ${{ runner.temp }}/oldoutput.txt
64-
diff ${{ runner.temp }}/oldoutput.txt ${{ runner.temp }}/newoutput.txt
60+
resultcode=0
61+
mkdir ${{ runner.temp }}/new
62+
mkdir ${{ runner.temp }}/old
63+
64+
#Generate the output for the default values file, and each of the specialised test files.
65+
#Check to see if anything has changed between old and new, and report the differences
66+
helm template helm/hpcc > ${{ runner.temp }}/new/output.txt
67+
for file in testing/helm/tests/*.yaml
68+
do
69+
tail=$(basename $file)
70+
helm template helm/hpcc --values $file > ${{ runner.temp }}/new/$tail.txt
71+
done
72+
73+
git fetch --no-tags --prune --progress --no-recurse-submodules --quiet --depth=1 origin ${{ github.base_ref }}
74+
echo git checkout ${{ github.base_ref }}^
75+
git checkout ${{ github.base_ref }}^
76+
77+
helm template helm/hpcc > ${{ runner.temp }}/old/output.txt
78+
for file in testing/helm/tests/*.yaml
79+
do
80+
tail=$(basename $file)
81+
helm template helm/hpcc --values $file > ${{ runner.temp }}/old/$tail.txt
82+
done
83+
84+
diff ${{ runner.temp }}/old/output.txt ${{ runner.temp }}/new/output.txt
85+
if [ $? -ne 0 ]
86+
then
87+
resultcode=1
88+
else
89+
#Only check for differences in the specialised test files if the default values file is the same
90+
for file in testing/helm/tests/*.yaml
91+
do
92+
tail=$(basename $file)
93+
echo Check $tail
94+
diff ${{ runner.temp }}/old/$tail.txt ${{ runner.temp }}/new/$tail.txt
95+
if [ $? -ne 0 ]
96+
then
97+
resultcode=1
98+
fi
99+
echo old
100+
grep "my-dali-plane" ${{ runner.temp }}/old/$tail.txt | cat
101+
echo new
102+
grep "my-dali-plane" ${{ runner.temp }}/new/$tail.txt | cat
103+
done
104+
fi
105+
106+
exit $resultcode

testing/helm/tests/implicitplanes.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ storage:
1717
storageClass: ""
1818
forcePermissions: true
1919
category: sasha
20-
- name: my-dali-plane
20+
- name: my-dali-planexx
2121
prefix: "/var/lib/HPCCSystems/dalistorage"
2222
storageSize: 1Gi
2323
storageClass: ""

0 commit comments

Comments
 (0)