From b313c196a16a2bd73c712ade5f36c7835fabf9eb Mon Sep 17 00:00:00 2001 From: Joakim Roubert Date: Fri, 6 Mar 2020 13:34:56 +0100 Subject: [PATCH 1/2] 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 --- scripts/package-cli | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/scripts/package-cli b/scripts/package-cli index 4ca3a6f27f..e848b03dd7 100755 --- a/scripts/package-cli +++ b/scripts/package-cli @@ -7,11 +7,10 @@ cd $(dirname $0)/.. GO=${GO-go} -rm -rf bin/crictl bin/kubectl bin/k3s-agent bin/k3s-server bin/kubectl bin/k3s build/data -ln -s containerd bin/k3s-agent -ln -s containerd bin/k3s-server -ln -s containerd bin/kubectl -ln -s containerd bin/crictl +for i in crictl kubectl k3s-agent k3s-server k3s; do + ln -fs containerd bin/$i +done + for i in bridge flannel host-local loopback portmap; do if [ -e ./bin/$i ]; then rm -f ./bin/$i @@ -58,8 +57,8 @@ LDFLAGS=" -w -s " STATIC="-extldflags '-static'" -if [ "$DQLITE" = "true" ]; then - DQLITE_TAGS="dqlite" +if [ "$DQLITE" = 'true' ]; then + DQLITE_TAGS='dqlite' fi CGO_ENABLED=0 "${GO}" build -tags "$DQLITE_TAGS" -ldflags "$LDFLAGS $STATIC" -o ${CMD_NAME} ./cmd/k3s/main.go From 9307fcc33228ab0b783039079fc4257127c71946 Mon Sep 17 00:00:00 2001 From: Joakim Roubert Date: Fri, 6 Mar 2020 13:34:56 +0100 Subject: [PATCH 2/2] package-cli: Remove redundant rm -rf build/data Moving symlinks to containerd to a for loop makes maintenance easier. It also reveals a duplicate, redundant, rm -rf build/data and one duplicate, redundant, rm -rf bin/kubectl, that can be both be purged. Change-Id: Id81a05dcf2dadcc60ef8171494a284fbe1630400 Signed-off-by: Joakim Roubert --- scripts/package-cli | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/scripts/package-cli b/scripts/package-cli index e848b03dd7..070ce4ae0a 100755 --- a/scripts/package-cli +++ b/scripts/package-cli @@ -8,7 +8,8 @@ cd $(dirname $0)/.. GO=${GO-go} for i in crictl kubectl k3s-agent k3s-server k3s; do - ln -fs containerd bin/$i + rm -f bin/$i + ln -s containerd bin/$i done for i in bridge flannel host-local loopback portmap; do