Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

scripts: add support for arch linux on install dependencies #547

Merged
merged 1 commit into from
Apr 28, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
34 changes: 24 additions & 10 deletions install-dependencies.sh
Original file line number Diff line number Diff line change
Expand Up @@ -22,13 +22,11 @@ set -euExo pipefail

debian_packages=(
ca-certificates
etcd
git
make
)

fedora_packages=(
etcd
git-core
golang-bin
make
Expand All @@ -39,11 +37,22 @@ fedora_packages=(
moby-engine
)

arch_packages=(
git
make
go
)

if [ "$ID" = "fedora" ]
then
sudo dnf install -y "${fedora_packages[@]}"
fi

if [ "$ID" = "arch" ]
then
sudo pacman -S --noconfirm --needed "${arch_packages[@]}"
fi

if [ "$ID" = "ubuntu" ] || [ "$ID" = "debian" ]
then
# If someone has a non-system installation of go, just use that.
Expand All @@ -63,8 +72,11 @@ fi

go install sigs.k8s.io/controller-tools/cmd/[email protected]

mkdir -p tmp
cd tmp
GOPATH="$(go env GOPATH)"
TMPDIR="$(mktemp -d)"
trap 'rm -rf "$TMPDIR"' EXIT

cd "$TMPDIR"

# Kubernetes commands don't work with "go get"
# https://github.com/kubernetes/kubernetes/issues/79384
Expand All @@ -73,11 +85,13 @@ cd kubernetes
# v1.19.x requires go 1.15.0
git checkout v1.18.9
make WHAT=cmd/kube-apiserver
cp _output/bin/kube-apiserver $(go env GOPATH)/bin
cd ..

cp _output/bin/kube-apiserver "$GOPATH"/bin
cd ..
rm -rf tmp

# KUBEBUILDER_ASSETS has to be a single directory
cp /usr/bin/etcd $(go env GOPATH)/bin
# Build etcd
git clone https://github.com/etcd-io/etcd.git
cd etcd
git checkout v3.4.15
go mod vendor
./build
cp ./bin/etcd "$GOPATH"/bin