Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
tabalt committed Jun 26, 2020
1 parent 9778ce2 commit 248f11c
Showing 1 changed file with 10 additions and 3 deletions.
13 changes: 10 additions & 3 deletions charts/pulsar/templates/keytool.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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}
Expand Down

0 comments on commit 248f11c

Please sign in to comment.