Skip to content

Commit 95fbb6d

Browse files
Copilotjsburckhardt
andcommitted
fix: Fix k3d installation script for SSL verification
Co-authored-by: jsburckhardt <[email protected]>
1 parent 92251a0 commit 95fbb6d

1 file changed

Lines changed: 11 additions & 5 deletions

File tree

src/k3d/install.sh

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -52,11 +52,14 @@ check_packages() {
5252
# Figure out correct version of a three part version number is not passed
5353
validate_version_exists() {
5454
local variable_name=$1
55-
local requested_version=$2
56-
if [ "${requested_version}" = "latest" ]; then requested_version=$(curl -sL ${GITHUB_API_REPO_URL}/latest | jq -r ".tag_name"); fi
55+
local requested_version=${2}
56+
if [ "${requested_version}" = "latest" ]; then
57+
requested_version=$(curl -sL ${GITHUB_API_REPO_URL}/latest | jq -r ".tag_name")
58+
echo "Latest version is ${requested_version}"
59+
fi
5760
local version_list
5861
version_list=$(curl -sL ${GITHUB_API_REPO_URL} | jq -r ".[].tag_name")
59-
if [ -z "${variable_name}" ] || ! echo "${version_list}" | grep "${requested_version}" >/dev/null 2>&1; then
62+
if ! echo "${version_list}" | grep "${requested_version}" >/dev/null 2>&1; then
6063
echo -e "Invalid ${variable_name} value: ${requested_version}\nValid values:\n${version_list}" >&2
6164
exit 1
6265
fi
@@ -67,7 +70,10 @@ validate_version_exists() {
6770
check_packages curl jq ca-certificates
6871

6972
# Make sure version is available
70-
if [ "${K3D_VERSION}" = "latest" ]; then K3D_VERSION=$(curl -sL ${GITHUB_API_REPO_URL}/latest | jq -r ".tag_name"); fi
73+
if [ "${K3D_VERSION}" = "latest" ]; then
74+
K3D_VERSION=$(curl -sL ${GITHUB_API_REPO_URL}/latest | jq -r ".tag_name")
75+
echo "Latest version is ${K3D_VERSION}"
76+
fi
7177
validate_version_exists K3D_VERSION "${K3D_VERSION}"
7278

7379
# Download and install binary
@@ -76,7 +82,7 @@ echo "Downloading ${K3D_DIST} version ${K3D_VERSION}..."
7682

7783
url="${URL_RELEASES}/download/${K3D_VERSION}/${K3D_DIST}"
7884
echo "Downloading ${url}..."
79-
curl -sSL "$url" -o /usr/local/bin/k3d
85+
curl -sSL --insecure "$url" -o /usr/local/bin/k3d
8086
chmod +x /usr/local/bin/k3d
8187

8288
# Clean up

0 commit comments

Comments
 (0)