Remove unused scripts files

Signed-off-by: Derek Nola <derek.nola@suse.com>
This commit is contained in:
Derek Nola
2025-04-25 10:34:16 -07:00
parent efef5a5a1a
commit 1797b5abc1
10 changed files with 0 additions and 221 deletions

View File

@@ -1,16 +0,0 @@
/*
Copyright The Kubernetes Authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/

View File

@@ -1,22 +0,0 @@
#!/bin/bash
set -e
cd $(dirname $0)/..
. ./scripts/setup-rancher-path.sh
GO=${GO-go}
# Prime sudo
sudo echo Compiling
if [ ! -e bin/containerd ]; then
./scripts/build
./scripts/package
else
rm -f ./bin/k3s-agent
"${GO}" build -tags "apparmor seccomp" -o ./bin/k3s-agent ./cmd/agent/main.go
fi
echo Starting agent
sudo env "PATH=$(pwd)/bin:$PATH" ./bin/k3s-agent --debug agent -s https://localhost:6443 -t $(<${RANCHER_PATH}/k3s/server/node-token) "$@"

View File

@@ -1,24 +0,0 @@
#!/bin/bash
set -e
cd $(dirname $0)/..
. ./scripts/setup-rancher-path.sh
IP=$(ip addr show dev docker0 | grep -w inet | awk '{print $2}' | cut -f1 -d/)
docker run \
--read-only \
--tmpfs /run \
--tmpfs /var/run \
--tmpfs /tmp \
-v /lib/modules:/lib/modules:ro \
-v /lib/firmware:/lib/firmware:ro \
-v /etc/ssl/certs/ca-certificates.crt:/etc/ssl/certs/ca-certificates.crt:ro \
-v $(pwd)/bin:/usr/bin \
-v /var/log \
-v /var/lib/kubelet \
-v /var/lib/rancher/k3s \
-v /var/lib/cni \
-v /usr/lib/x86_64-linux-gnu/libsqlite3.so.0:/usr/lib/x86_64-linux-gnu/libsqlite3.so.0:ro \
--privileged \
ubuntu:18.04 /usr/bin/k3s-agent agent -t $(<${RANCHER_PATH}/k3s/server/node-token) -s https://${IP}:6443

View File

@@ -1,15 +0,0 @@
#!/bin/bash
set -e
GO=${GO-go}
mkdir -p $(dirname $0)/../bin
cd $(dirname $0)/../bin
echo Running
ARGS="--disable-agent"
if echo -- "$@" | grep -q rootless; then
ARGS=""
PATH=$(pwd):$PATH
fi
"${GO}" run -tags "apparmor" ../main.go server $ARGS "$@"

View File

@@ -1,37 +0,0 @@
#!/bin/bash
# Check for AWS Credentials
[ -n "$AWS_SECRET_ACCESS_KEY" ] || {
echo "AWS_SECRET_ACCESS_KEY is not set"
exit 0
}
[ -n "$AWS_ACCESS_KEY_ID" ] || {
echo "AWS_ACCESS_KEY_ID is not set"
exit 0
}
[ -d "$1" ] || {
echo "First argument should be a directory" >&2
exit 1
}
umask 077
GO=${GO-go}
TMPDIR=$(mktemp -d)
cleanup() {
exit_code=$?
trap - EXIT INT
rm -rf ${TMPDIR}
exit ${exit_code}
}
trap cleanup EXIT INT
LOG_TGZ=k3s-log-$(date +%s)-$("${GO}" env GOARCH)-$(git rev-parse --short HEAD)-$(basename $1).tgz
tar -cz -f ${TMPDIR}/${LOG_TGZ} -C $(dirname $1) $(basename $1)
aws s3 cp ${TMPDIR}/${LOG_TGZ} s3://k3s-ci-logs || exit 1
echo "Logs uploaded" >&2
echo "https://k3s-ci-logs.s3.amazonaws.com/${LOG_TGZ}"

View File

@@ -1,80 +0,0 @@
#!/bin/bash
set -e -x
cd $(dirname $0)/..
ARCH=${DRONE_STAGE_ARCH:-$(arch)}
. ./scripts/version.sh
if [[ ! "$VERSION" =~ ^v[0-9]+\.[0-9]+\.[0-9]+(\-[^\+]*)?\+k3s.+$ ]]; then
echo "k3s version $VERSION does not match regex for rpm upload"
exit 0
fi
TMPDIR=$(mktemp -d)
cleanup() {
exit_code=$?
trap - EXIT INT
rm -rf ${TMPDIR}
exit ${exit_code}
}
trap cleanup EXIT INT
export HOME=${TMPDIR}
BIN_SUFFIX=""
if [ ${ARCH} = aarch64 ] || [ ${ARCH} = arm64 ]; then
BIN_SUFFIX="-arm64"
elif [ ${ARCH} = armv7l ] || [ ${ARCH} = arm ]; then
BIN_SUFFIX="-armhf"
elif [ ${ARCH} = s390x ]; then
BIN_SUFFIX="-s390x"
fi
# capture version of k3s
k3s_version=$(sed -E -e 's/^v([^-+]*).*$/\1/' <<< $VERSION)
# capture pre-release and metadata information of k3s
k3s_release=$(sed -E -e 's/\+k3s/+/; s/\+/-/g; s/^[^-]*//; s/^--/dev-/; s/-+/./g; s/^\.+//; s/\.+$//;' <<< $VERSION)
# k3s-selinux policy version needed for functionality
k3s_policyver=0.1-1
rpmbuild \
--define "k3s_version ${k3s_version}" \
--define "k3s_release ${k3s_release}" \
--define "k3s_policyver ${k3s_policyver}" \
--define "k3s_binary k3s${BIN_SUFFIX}" \
--define "_sourcedir ${PWD}" \
--define "_specdir ${PWD}" \
--define "_builddir ${PWD}" \
--define "_srcrpmdir ${PWD}" \
--define "_rpmdir ${PWD}/dist/rpm" \
--define "_buildrootdir ${PWD}/.rpm-build" \
-bb package/rpm/k3s.spec
if ! grep "BEGIN PGP PRIVATE KEY BLOCK" <<<"$PRIVATE_KEY"; then
echo "PRIVATE_KEY not defined, skipping rpm sign and upload"
exit 0
fi
cat <<\EOF >~/.rpmmacros
%_signature gpg
%_gpg_name ci@rancher.com
EOF
gpg --import - <<<"$PRIVATE_KEY"
expect <<EOF
set timeout 60
spawn sh -c "rpmsign --addsign dist/rpm/**/k3s-*.rpm"
expect "Enter pass phrase:"
send -- "$PRIVATE_KEY_PASS_PHRASE\r"
expect eof
lassign [wait] _ _ _ code
exit \$code
EOF
if [ -z "$AWS_S3_BUCKET" ]; then
echo "AWS_S3_BUCKET skipping rpm upload"
exit 0
fi
rpm-s3 --bucket $AWS_S3_BUCKET dist/rpm/**/k3s-*.rpm

View File

@@ -1,3 +0,0 @@
#!/bin/bash
SKIP_VALIDATE=true $(dirname $0)/ci

View File

@@ -1,7 +0,0 @@
#!/bin/bash
if [ $(id -u) = 0 ]; then
RANCHER_PATH="/var/lib/rancher"
else
RANCHER_PATH="$HOME/.rancher"
fi

View File

@@ -1,16 +0,0 @@
#!/bin/bash
if [ ! -d $1/staging/src/k8s.io ]; then
echo Kubernetes source not found at $1
exit 1
fi
cd $(dirname $0)/../vendor/k8s.io
for i in $1/staging/src/k8s.io/*; do
rm -rf $(basename $i)
ln -s $i .
done
rm -rf kubernetes
mkdir -p kubernetes
cd kubernetes
ln -s $1/{cmd,pkg,plugin,third_party,openapi.json,openapi.pb} .