Perform JSON escaping of strings (#3919)

This commit is contained in:
Tariq Ibrahim 2018-09-28 17:18:54 -07:00 коммит произвёл Jack Francis
Родитель 3213101c24
Коммит e4cb44c04c
1 изменённых файлов: 3 добавлений и 0 удалений

Просмотреть файл

@ -134,6 +134,9 @@ function configureK8s() {
set +x
echo "${KUBELET_PRIVATE_KEY}" | base64 --decode > "${KUBELET_PRIVATE_KEY_PATH}"
echo "${APISERVER_PUBLIC_KEY}" | base64 --decode > "${APISERVER_PUBLIC_KEY_PATH}"
# Perform the required JSON escaping for special characters " and \
SERVICE_PRINCIPAL_CLIENT_SECRET=$(echo $SERVICE_PRINCIPAL_CLIENT_SECRET | sed "s|\\\\|\\\\\\\|g")
SERVICE_PRINCIPAL_CLIENT_SECRET=$(echo $SERVICE_PRINCIPAL_CLIENT_SECRET | sed 's|"|\\"|g')
cat << EOF > "${AZURE_JSON_PATH}"
{
"cloud":"${TARGET_ENVIRONMENT}",