Skip to content
This repository has been archived by the owner on Sep 3, 2020. It is now read-only.

Commit

Permalink
Fix handling of long username/password
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
anguslees authored and bonifaido committed May 6, 2019
1 parent 4346dd6 commit ad1fd17
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion plugin.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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/}

Expand Down

0 comments on commit ad1fd17

Please sign in to comment.