From 396fabf2af37d080a4d41392455f65ff225e866e Mon Sep 17 00:00:00 2001 From: Deyuan Deng Date: Tue, 9 Jun 2015 20:02:35 -0400 Subject: [PATCH] Document why we use 'tr -d' instead of 'base64 w0' --- cluster/gce/util.sh | 2 ++ 1 file changed, 2 insertions(+) diff --git a/cluster/gce/util.sh b/cluster/gce/util.sh index 54de81ee9bb..121298cb84a 100755 --- a/cluster/gce/util.sh +++ b/cluster/gce/util.sh @@ -550,6 +550,8 @@ function create-certs { exit 2 } CERT_DIR="${KUBE_TEMP}/easy-rsa-master/easyrsa3" + # By default, linux wraps base64 output every 76 cols, so we use 'tr -d' to remove whitespaces. + # Note 'base64 -w0' doesn't work on Mac OS X, which has different flags. CA_CERT_BASE64=$(cat "${CERT_DIR}/pki/ca.crt" | base64 | tr -d '\r\n') MASTER_CERT_BASE64=$(cat "${CERT_DIR}/pki/issued/${MASTER_NAME}.crt" | base64 | tr -d '\r\n') MASTER_KEY_BASE64=$(cat "${CERT_DIR}/pki/private/${MASTER_NAME}.key" | base64 | tr -d '\r\n')