Skip to content

Commit 34831f0

Browse files
committed
Pin docker-credential-helpers for old go installs
1 parent fb53af6 commit 34831f0

File tree

1 file changed

+12
-1
lines changed

1 file changed

+12
-1
lines changed

travis-build-scripts/install-credential-helper.sh

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,18 @@ mkdir -p $GOPATH/src/github.com/docker
2626
cd $GOPATH/src/github.com/docker
2727
git clone https://github.com/docker/docker-credential-helpers
2828
cd docker-credential-helpers
29-
make pass
29+
30+
# After https://github.com/docker/docker-credential-helpers/commit/fd0197473f0ecb29e73ccef9028057194ff463bc go 1.18 is required... Pin commit if earlier go installed
31+
go_version="$(go version | cut -f3 -d' ')"
32+
IFS=. read -a go_version_parts <<<"$go_version"
33+
go_major="${go_version_parts[0]##go}"
34+
go_minor="${go_version_parts[1]}"
35+
if [[ "$go_major" -eq 1 && "$go_minor" -lt 18 ]]; then
36+
echo "Go version ${go_major}.${go_minor} < 1.18... Pinning credential-helper commit"
37+
git checkout ab7fd12c67d83193072fa91e5648b036547f6323
38+
fi
39+
40+
make pass
3041
cp bin/docker-credential-pass $GOPATH/bin/docker-credential-pass
3142
mkdir -p /home/travis/.docker
3243
echo '{ "credsStore": "pass" }' | tee /home/travis/.docker/config.json

0 commit comments

Comments
 (0)