Fixed apache/pulsar-helm-chart#25 (#27)
This commit is contained in:
parent
9778ce2fe1
commit
248f11c932
@ -40,19 +40,26 @@ data:
|
|||||||
keyStoreFile=/pulsar/${component}.keystore.jks
|
keyStoreFile=/pulsar/${component}.keystore.jks
|
||||||
trustStoreFile=/pulsar/${component}.truststore.jks
|
trustStoreFile=/pulsar/${component}.truststore.jks
|
||||||
|
|
||||||
function ensureFileNotEmpty() {
|
function checkFile() {
|
||||||
local file=$1
|
local file=$1
|
||||||
local len=$(wc -c ${file} | awk '{print $1}')
|
local len=$(wc -c ${file} | awk '{print $1}')
|
||||||
echo "processing ${file} : len = ${len}"
|
echo "processing ${file} : len = ${len}"
|
||||||
if [ ! -f ${file} ]; then
|
if [ ! -f ${file} ]; then
|
||||||
echo "${file} is not found"
|
echo "${file} is not found"
|
||||||
exit -1
|
return -1
|
||||||
fi
|
fi
|
||||||
if [ $len -le 0 ]; then
|
if [ $len -le 0 ]; then
|
||||||
echo "${file} is empty"
|
echo "${file} is empty"
|
||||||
exit -1
|
return -1
|
||||||
fi
|
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 ${crtFile}
|
||||||
ensureFileNotEmpty ${keyFile}
|
ensureFileNotEmpty ${keyFile}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user