package-cli: Remove redundant rm -rf build/data

Moving symlinks to containerd to a for loop makes maintenance easier;
also using the -f flag for ln rather than having a separate rm step.
It also reveals a duplicate, redundant, rm -rf build/data and one
duplicate, redundant, rm -rf bin/kubectl, that can be both be purged.

Signed-off-by: Joakim Roubert <joakim.roubert@axis.com>
pull/1500/head
Joakim Roubert 5 years ago
parent c14dac9aa4
commit b313c196a1

@ -7,11 +7,10 @@ cd $(dirname $0)/..
GO=${GO-go} GO=${GO-go}
rm -rf bin/crictl bin/kubectl bin/k3s-agent bin/k3s-server bin/kubectl bin/k3s build/data for i in crictl kubectl k3s-agent k3s-server k3s; do
ln -s containerd bin/k3s-agent ln -fs containerd bin/$i
ln -s containerd bin/k3s-server done
ln -s containerd bin/kubectl
ln -s containerd bin/crictl
for i in bridge flannel host-local loopback portmap; do for i in bridge flannel host-local loopback portmap; do
if [ -e ./bin/$i ]; then if [ -e ./bin/$i ]; then
rm -f ./bin/$i rm -f ./bin/$i
@ -58,8 +57,8 @@ LDFLAGS="
-w -s -w -s
" "
STATIC="-extldflags '-static'" STATIC="-extldflags '-static'"
if [ "$DQLITE" = "true" ]; then if [ "$DQLITE" = 'true' ]; then
DQLITE_TAGS="dqlite" DQLITE_TAGS='dqlite'
fi fi
CGO_ENABLED=0 "${GO}" build -tags "$DQLITE_TAGS" -ldflags "$LDFLAGS $STATIC" -o ${CMD_NAME} ./cmd/k3s/main.go CGO_ENABLED=0 "${GO}" build -tags "$DQLITE_TAGS" -ldflags "$LDFLAGS $STATIC" -o ${CMD_NAME} ./cmd/k3s/main.go

Loading…
Cancel
Save