Skip to content

Commit 8423204

Browse files
committed
prepackage any prepackaged certs
1 parent 40922c9 commit 8423204

File tree

1 file changed

+26
-0
lines changed

1 file changed

+26
-0
lines changed

pkg/centos7/entrypoint.sh

+26
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,32 @@ if [ -f /data/hubble_buildinfo ]; then
2525
cat /data/hubble_buildinfo >> /hubble_build/hubblestack/__init__.py
2626
fi 2>/dev/null
2727

28+
cat > /data/pre_packaged_certificates.py << EOF
29+
ca_crt = list()
30+
public_crt = list()
31+
EOF
32+
do_pkg_crts=0
33+
if [ -f /data/certs/ca-root.crt ]; then
34+
echo "ca_crt.append('''$(< /data/certs/ca-root.crt)''')" \
35+
>> /data/pre_packaged_certificates.py
36+
for item in /data/certs/int*.crt; do
37+
if [ -f "$item" ]
38+
then echo "ca_crt.append('''$(< "$item")''')" \
39+
>> /data/pre_packaged_certificates.py
40+
fi
41+
done
42+
do_pkg_crts=$(( do_pkg_crts + 1 ))
43+
fi
44+
for item in /data/certs/{pub,sign}*.crt; do
45+
if [ -f "$item" ]
46+
then echo "public_crt.append('''$(< "$item")''')" \
47+
>> /data/pre_packaged_certificates.py
48+
fi
49+
do_pkg_crts=$(( do_pkg_crts + 1 ))
50+
done
51+
if [ $do_pkg_crts -gt 0 ]
52+
then cp /data/pre_packaged_certificates.py /hubble_build/hubblestack
53+
fi
2854

2955
cd /hubble_build
3056

0 commit comments

Comments
 (0)