From ad1fd17aa568d01cae88402c1a63ecd4af29c8fa Mon Sep 17 00:00:00 2001 From: Angus Lees Date: Mon, 6 May 2019 11:30:48 +1000 Subject: [PATCH] Fix handling of long username/password Apparently the busybox implementation of `base64` will line-wrap long output strings. This meant that long username+password combinations could produce base64 that contained spurious "\n" characters, which then led to: ``` 2019/05/06 00:47:39 Unable to parse "/kaniko/.docker/config.json": invalid character '\n' in string literal ``` Fixed by just removing the newlines in base64 output. A "better" solution would use a different base64 implementation that avoided line-wrapping in the first place. --- plugin.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugin.sh b/plugin.sh index b7e1088..2c18670 100755 --- a/plugin.sh +++ b/plugin.sh @@ -4,7 +4,7 @@ set -euo pipefail export PATH=$PATH:/kaniko/ -DOCKER_AUTH=`echo -n "${PLUGIN_USERNAME}:${PLUGIN_PASSWORD}" | base64` +DOCKER_AUTH=`echo -n "${PLUGIN_USERNAME}:${PLUGIN_PASSWORD}" | base64 | tr -d "\n"` REGISTRY=${PLUGIN_REGISTRY:-https://index.docker.io/v1/}