Skip to content

Commit 0a0eecc

Browse files
authored
chore(install-ege): remove checksum validation from install script
linkerd/linkerd2#14511 removed sha256 digests from cli builds. This updates the install script to skip sha validation
1 parent 2539b79 commit 0a0eecc

File tree

1 file changed

+9
-44
lines changed

1 file changed

+9
-44
lines changed

run.linkerd.io/public/install-edge

Lines changed: 9 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -32,29 +32,6 @@ happyexit() {
3232
exit 0
3333
}
3434

35-
validate_checksum() {
36-
filename=$1
37-
SHA=$(curl --proto '=https' --tlsv1.2 -sSfL "${url}.sha256")
38-
echo ""
39-
echo "Validating checksum..."
40-
41-
case $checksumbin in
42-
*openssl)
43-
checksum=$($checksumbin dgst -sha256 "${filename}" | sed -e 's/^.* //')
44-
;;
45-
*shasum)
46-
checksum=$($checksumbin -a256 "${filename}" | sed -e 's/ .*$//')
47-
;;
48-
esac
49-
50-
if [ "$checksum" != "$SHA" ]; then
51-
echo "Checksum validation failed." >&2
52-
return 1
53-
fi
54-
echo "Checksum valid."
55-
return 0
56-
}
57-
5835
OS=$(uname -s)
5936
arch=$(uname -m)
6037
cli_arch=""
@@ -106,12 +83,6 @@ case $OS in
10683
esac
10784
OS=$(echo "$OS" | tr '[:upper:]' '[:lower:]')
10885

109-
checksumbin=$(command -v openssl) || checksumbin=$(command -v shasum) || {
110-
echo "Failed to find checksum binary. Please install openssl or shasum."
111-
exit 1
112-
}
113-
114-
11586
tmpdir=$(mktemp -d /tmp/linkerd2.XXXXXX)
11687
srcfile="linkerd2-cli-${LINKERD2_VERSION}-${OS}"
11788
if [ -n "${cli_arch}" ]; then
@@ -121,17 +92,15 @@ dstfile="${INSTALLROOT}/bin/linkerd-${LINKERD2_VERSION}"
12192
url="https://github.com/linkerd/linkerd2/releases/download/${LINKERD2_VERSION}/${srcfile}"
12293

12394
if [ -e "${dstfile}" ]; then
124-
if validate_checksum "${dstfile}"; then
125-
echo ""
126-
echo "Linkerd ${LINKERD2_VERSION} was already downloaded; making it the default 🎉"
127-
echo ""
128-
echo "To force re-downloading, delete '${dstfile}' then run me again."
129-
(
130-
rm -f "${INSTALLROOT}/bin/linkerd"
131-
ln -s "${dstfile}" "${INSTALLROOT}/bin/linkerd"
132-
)
133-
happyexit
134-
fi
95+
echo ""
96+
echo "Linkerd ${LINKERD2_VERSION} was already downloaded; making it the default 🎉"
97+
echo ""
98+
echo "To force re-downloading, delete '${dstfile}' then run me again."
99+
(
100+
rm -f "${INSTALLROOT}/bin/linkerd"
101+
ln -s "${dstfile}" "${INSTALLROOT}/bin/linkerd"
102+
)
103+
happyexit
135104
fi
136105

137106
(
@@ -140,10 +109,6 @@ fi
140109
echo "Downloading ${srcfile}..."
141110
curl --proto '=https' --tlsv1.2 -fLO "${url}"
142111
echo "Download complete!"
143-
144-
if ! validate_checksum "${srcfile}"; then
145-
exit 1
146-
fi
147112
echo ""
148113
)
149114

0 commit comments

Comments
 (0)