-
Notifications
You must be signed in to change notification settings - Fork 149
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'main' into dependabot/go_modules/github.com/elastic/ela…
…stic-agent-system-metrics-0.8.1
- Loading branch information
Showing
90 changed files
with
2,778 additions
and
1,271 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
#!/usr/bin/env bash | ||
set -exuo pipefail | ||
|
||
echo "--- Install Kind" | ||
|
||
MSG="environment variable missing." | ||
DEFAULT_HOME="/usr/local" | ||
KIND_VERSION=${KIND_VERSION:?$MSG} | ||
HOME=${HOME:?$DEFAULT_HOME} | ||
KIND_CMD="${HOME}/bin/kind" | ||
|
||
if command -v kind | ||
then | ||
set +e | ||
echo "Found Kind. Checking version.." | ||
FOUND_KIND_VERSION=$(kind --version 2>&1 >/dev/null | awk '{print $3}') | ||
if [ "$FOUND_KIND_VERSION" == "$KIND_VERSION" ] | ||
then | ||
echo "Versions match. No need to install Kind. Exiting." | ||
exit 0 | ||
fi | ||
set -e | ||
fi | ||
|
||
echo "Installing Kind" | ||
|
||
OS=$(uname -s| tr '[:upper:]' '[:lower:]') | ||
ARCH=$(uname -m| tr '[:upper:]' '[:lower:]') | ||
if [ "${ARCH}" == "aarch64" ] ; then | ||
ARCH_SUFFIX=arm64 | ||
else | ||
ARCH_SUFFIX=amd64 | ||
fi | ||
|
||
mkdir -p "${HOME}/bin" | ||
|
||
if curl -sSLo "${KIND_CMD}" "https://github.com/kubernetes-sigs/kind/releases/download/${KIND_VERSION}/kind-${OS}-${ARCH_SUFFIX}" ; then | ||
chmod +x "${KIND_CMD}" | ||
else | ||
echo "Something bad with the download, let's delete the corrupted binary" | ||
if [ -e "${KIND_CMD}" ] ; then | ||
rm "${KIND_CMD}" | ||
fi | ||
exit 1 | ||
fi |
Oops, something went wrong.