summaryrefslogtreecommitdiff
path: root/build/tools
diff options
context:
space:
mode:
authorjun.gu <jun.gu@easystack.cn>2021-11-30 16:52:09 +0800
committerjun.gu <jun.gu@easystack.cn>2021-12-01 10:55:05 +0800
commit61c246924c587f2515a9605af462ecd0680be700 (patch)
tree3f3c9e36fbecffe5980f97786cf8a8ec93a08e35 /build/tools
parentMerge pull request #3409 from mjlshen/3385 (diff)
downloadkubeedge-61c246924c587f2515a9605af462ecd0680be700.tar.gz
Optimize script when create stream cert
Signed-off-by: jun.gu <jun.gu@easystack.cn>
Diffstat (limited to 'build/tools')
-rwxr-xr-xbuild/tools/certgen.sh7
1 files changed, 4 insertions, 3 deletions
diff --git a/build/tools/certgen.sh b/build/tools/certgen.sh
index 7e7532d6e..53962a8b5 100755
--- a/build/tools/certgen.sh
+++ b/build/tools/certgen.sh
@@ -67,8 +67,9 @@ stream() {
readonly STREAM_KEY_FILE=${certPath}/stream.key
readonly STREAM_CSR_FILE=${certPath}/stream.csr
readonly STREAM_CRT_FILE=${certPath}/stream.crt
- readonly K8SCA_FILE=/etc/kubernetes/pki/ca.crt
- readonly K8SCA_KEY_FILE=/etc/kubernetes/pki/ca.key
+
+ readonly K8SCA_FILE=${K8SCA_FILE:-/etc/kubernetes/pki/ca.crt}
+ readonly K8SCA_KEY_FILE=${K8SCA_KEY_FILE:-/etc/kubernetes/pki/ca.key}
if [ -z ${CLOUDCOREIPS} ]; then
echo "You must set CLOUDCOREIPS Env,The environment variable is set to specify the IP addresses of all cloudcore"
@@ -84,7 +85,7 @@ stream() {
SUBJECTALTNAME="${SUBJECTALTNAME}IP.${index}:${ip}"
done
- cp /etc/kubernetes/pki/ca.crt ${caPath}/streamCA.crt
+ cp ${K8SCA_FILE} ${caPath}/streamCA.crt
echo $SUBJECTALTNAME > /tmp/server-extfile.cnf
openssl genrsa -out ${STREAM_KEY_FILE} 2048