Fixed apache/pulsar-helm-chart#25 (#27)

This commit is contained in:
tabalt 2020-06-26 09:33:54 +08:00 committed by GitHub
parent 9778ce2fe1
commit 248f11c932
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -40,19 +40,26 @@ data:
keyStoreFile=/pulsar/${component}.keystore.jks
trustStoreFile=/pulsar/${component}.truststore.jks
function ensureFileNotEmpty() {
function checkFile() {
local file=$1
local len=$(wc -c ${file} | awk '{print $1}')
echo "processing ${file} : len = ${len}"
if [ ! -f ${file} ]; then
echo "${file} is not found"
exit -1
return -1
fi
if [ $len -le 0 ]; then
echo "${file} is empty"
exit -1
return -1
fi
}
function ensureFileNotEmpty() {
local file=$1
until checkFile ${file}; do
echo "file isn't initialized yet ... check in 3 seconds ..." && sleep 3;
done;
}
ensureFileNotEmpty ${crtFile}
ensureFileNotEmpty ${keyFile}