scripts: add missing quotes, and minor linting issues
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
This commit is contained in:
parent
0cb656860f
commit
dba0ef4eb5
@ -45,4 +45,4 @@ case "${SELINUX}" in
|
|||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
|
|
||||||
echo SELinux is $(getenforce)
|
echo SELinux is "$(getenforce)"
|
||||||
|
@ -28,7 +28,7 @@ CNI_CONFIG_DIR=${DESTDIR}/etc/cni/net.d
|
|||||||
TMPROOT=$(mktemp -d)
|
TMPROOT=$(mktemp -d)
|
||||||
git clone https://github.com/containernetworking/plugins.git "${TMPROOT}"/plugins
|
git clone https://github.com/containernetworking/plugins.git "${TMPROOT}"/plugins
|
||||||
pushd "${TMPROOT}"/plugins
|
pushd "${TMPROOT}"/plugins
|
||||||
git checkout $CNI_COMMIT
|
git checkout "$CNI_COMMIT"
|
||||||
./build_linux.sh
|
./build_linux.sh
|
||||||
mkdir -p $CNI_DIR
|
mkdir -p $CNI_DIR
|
||||||
cp -r ./bin $CNI_DIR
|
cp -r ./bin $CNI_DIR
|
||||||
|
@ -37,7 +37,7 @@ split_ip() {
|
|||||||
local -r varname="$1"
|
local -r varname="$1"
|
||||||
local -r ip="$2"
|
local -r ip="$2"
|
||||||
for i in {0..3}; do
|
for i in {0..3}; do
|
||||||
eval "$varname"[$i]=$( echo "$ip" | cut -d '.' -f $((i + 1)) )
|
eval "$varname"[$i]="$( echo "$ip" | cut -d '.' -f $((i + 1)) )"
|
||||||
done
|
done
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -26,16 +26,17 @@ cd "$GOPATH"
|
|||||||
go get -u github.com/onsi/ginkgo/ginkgo
|
go get -u github.com/onsi/ginkgo/ginkgo
|
||||||
|
|
||||||
: "${CRITEST_COMMIT:=$(cat "${script_dir}/critools-version")}"
|
: "${CRITEST_COMMIT:=$(cat "${script_dir}/critools-version")}"
|
||||||
|
: "${DESTDIR:=""}"
|
||||||
|
|
||||||
TMPROOT=$(mktemp -d)
|
TMPROOT=$(mktemp -d)
|
||||||
git clone https://github.com/kubernetes-sigs/cri-tools.git "${TMPROOT}"/cri-tools
|
git clone https://github.com/kubernetes-sigs/cri-tools.git "${TMPROOT}/cri-tools"
|
||||||
pushd "${TMPROOT}"/cri-tools
|
pushd "${TMPROOT}"/cri-tools
|
||||||
git checkout "$CRITEST_COMMIT"
|
git checkout "$CRITEST_COMMIT"
|
||||||
make
|
make
|
||||||
make install -e DESTDIR=${DESTDIR:=''} BINDIR=/usr/local/bin
|
make install -e DESTDIR="${DESTDIR}" BINDIR=/usr/local/bin
|
||||||
|
|
||||||
mkdir -p ${DESTDIR:=''}/etc/
|
mkdir -p "${DESTDIR}/etc/"
|
||||||
cat << EOF | tee ${DESTDIR:=''}/etc/crictl.yaml
|
cat << EOF | tee "${DESTDIR}/etc/crictl.yaml"
|
||||||
runtime-endpoint: unix:///run/containerd/containerd.sock
|
runtime-endpoint: unix:///run/containerd/containerd.sock
|
||||||
EOF
|
EOF
|
||||||
|
|
||||||
|
@ -28,27 +28,27 @@ PROTOBUF_DIR=$(mktemp -d)
|
|||||||
case $GOARCH in
|
case $GOARCH in
|
||||||
|
|
||||||
arm64)
|
arm64)
|
||||||
wget -O $PROTOBUF_DIR/protobuf "https://github.com/protocolbuffers/protobuf/releases/download/v$PROTOBUF_VERSION/protoc-$PROTOBUF_VERSION-linux-aarch64.zip"
|
wget -O "$PROTOBUF_DIR/protobuf" "https://github.com/protocolbuffers/protobuf/releases/download/v$PROTOBUF_VERSION/protoc-$PROTOBUF_VERSION-linux-aarch64.zip"
|
||||||
unzip $PROTOBUF_DIR/protobuf -d /usr/local
|
unzip "$PROTOBUF_DIR/protobuf" -d /usr/local
|
||||||
;;
|
;;
|
||||||
|
|
||||||
amd64|386)
|
amd64|386)
|
||||||
if [ "$GOOS" = windows ]; then
|
if [ "$GOOS" = windows ]; then
|
||||||
wget -O $PROTOBUF_DIR/protobuf "https://github.com/protocolbuffers/protobuf/releases/download/v$PROTOBUF_VERSION/protoc-$PROTOBUF_VERSION-win32.zip"
|
wget -O "$PROTOBUF_DIR/protobuf" "https://github.com/protocolbuffers/protobuf/releases/download/v$PROTOBUF_VERSION/protoc-$PROTOBUF_VERSION-win32.zip"
|
||||||
elif [ "$GOOS" = linux ]; then
|
elif [ "$GOOS" = linux ]; then
|
||||||
wget -O $PROTOBUF_DIR/protobuf "https://github.com/protocolbuffers/protobuf/releases/download/v$PROTOBUF_VERSION/protoc-$PROTOBUF_VERSION-linux-x86_64.zip"
|
wget -O "$PROTOBUF_DIR/protobuf" "https://github.com/protocolbuffers/protobuf/releases/download/v$PROTOBUF_VERSION/protoc-$PROTOBUF_VERSION-linux-x86_64.zip"
|
||||||
fi
|
fi
|
||||||
unzip $PROTOBUF_DIR/protobuf -d /usr/local
|
unzip "$PROTOBUF_DIR/protobuf" -d /usr/local
|
||||||
;;
|
;;
|
||||||
|
|
||||||
ppc64le)
|
ppc64le)
|
||||||
wget -O $PROTOBUF_DIR/protobuf "https://github.com/protocolbuffers/protobuf/releases/download/v$PROTOBUF_VERSION/protoc-$PROTOBUF_VERSION-linux-ppcle_64.zip"
|
wget -O "$PROTOBUF_DIR/protobuf" "https://github.com/protocolbuffers/protobuf/releases/download/v$PROTOBUF_VERSION/protoc-$PROTOBUF_VERSION-linux-ppcle_64.zip"
|
||||||
unzip $PROTOBUF_DIR/protobuf -d /usr/local
|
unzip "$PROTOBUF_DIR/protobuf" -d /usr/local
|
||||||
;;
|
;;
|
||||||
*)
|
*)
|
||||||
wget -O $PROTOBUF_DIR/protobuf "https://github.com/protocolbuffers/protobuf/releases/download/v$PROTOBUF_VERSION/protobuf-cpp-$PROTOBUF_VERSION.zip"
|
wget -O "$PROTOBUF_DIR/protobuf" "https://github.com/protocolbuffers/protobuf/releases/download/v$PROTOBUF_VERSION/protobuf-cpp-$PROTOBUF_VERSION.zip"
|
||||||
unzip $PROTOBUF_DIR/protobuf -d /usr/src/protobuf
|
unzip "$PROTOBUF_DIR/protobuf" -d /usr/src/protobuf
|
||||||
cd /usr/src/protobuf/protobuf-$PROTOBUF_VERSION
|
cd "/usr/src/protobuf/protobuf-$PROTOBUF_VERSION"
|
||||||
./autogen.sh
|
./autogen.sh
|
||||||
./configure --disable-shared
|
./configure --disable-shared
|
||||||
make
|
make
|
||||||
@ -57,4 +57,4 @@ ppc64le)
|
|||||||
ldconfig
|
ldconfig
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
rm -rf $PROTOBUF_DIR
|
rm -rf "$PROTOBUF_DIR"
|
||||||
|
@ -23,7 +23,8 @@ set -eu -o pipefail
|
|||||||
set -x
|
set -x
|
||||||
|
|
||||||
export SECCOMP_VERSION=2.5.1
|
export SECCOMP_VERSION=2.5.1
|
||||||
export SECCOMP_PATH=$(mktemp -d)
|
SECCOMP_PATH=$(mktemp -d)
|
||||||
|
export SECCOMP_PATH
|
||||||
curl -fsSL "https://github.com/seccomp/libseccomp/releases/download/v${SECCOMP_VERSION}/libseccomp-${SECCOMP_VERSION}.tar.gz" | tar -xzC "$SECCOMP_PATH" --strip-components=1
|
curl -fsSL "https://github.com/seccomp/libseccomp/releases/download/v${SECCOMP_VERSION}/libseccomp-${SECCOMP_VERSION}.tar.gz" | tar -xzC "$SECCOMP_PATH" --strip-components=1
|
||||||
(
|
(
|
||||||
cd "$SECCOMP_PATH"
|
cd "$SECCOMP_PATH"
|
||||||
|
@ -17,8 +17,8 @@
|
|||||||
set -o nounset
|
set -o nounset
|
||||||
set -o pipefail
|
set -o pipefail
|
||||||
|
|
||||||
source $(dirname "${BASH_SOURCE[0]}")/utils.sh
|
source "$(dirname "${BASH_SOURCE[0]}")/utils.sh"
|
||||||
cd ${ROOT}
|
cd "${ROOT}"
|
||||||
|
|
||||||
# FOCUS focuses the test to run.
|
# FOCUS focuses the test to run.
|
||||||
FOCUS=${FOCUS:-""}
|
FOCUS=${FOCUS:-""}
|
||||||
@ -29,15 +29,15 @@ RUNTIME=${RUNTIME:-""}
|
|||||||
|
|
||||||
CRI_ROOT="${CONTAINERD_ROOT}/io.containerd.grpc.v1.cri"
|
CRI_ROOT="${CONTAINERD_ROOT}/io.containerd.grpc.v1.cri"
|
||||||
|
|
||||||
mkdir -p ${REPORT_DIR}
|
mkdir -p "${REPORT_DIR}"
|
||||||
test_setup ${REPORT_DIR}
|
test_setup "${REPORT_DIR}"
|
||||||
|
|
||||||
# Run integration test.
|
# Run integration test.
|
||||||
${sudo} bin/cri-integration.test --test.run="${FOCUS}" --test.v \
|
${sudo} bin/cri-integration.test --test.run="${FOCUS}" --test.v \
|
||||||
--cri-endpoint=${CONTAINERD_SOCK} \
|
--cri-endpoint="${CONTAINERD_SOCK}" \
|
||||||
--cri-root=${CRI_ROOT} \
|
--cri-root="${CRI_ROOT}" \
|
||||||
--runtime-handler=${RUNTIME} \
|
--runtime-handler="${RUNTIME}" \
|
||||||
--containerd-bin=${CONTAINERD_BIN} \
|
--containerd-bin="${CONTAINERD_BIN}" \
|
||||||
--image-list="${TEST_IMAGE_LIST:-}"
|
--image-list="${TEST_IMAGE_LIST:-}"
|
||||||
|
|
||||||
test_exit_code=$?
|
test_exit_code=$?
|
||||||
|
@ -83,7 +83,7 @@ pid=
|
|||||||
|
|
||||||
# NOTE: We don't have the sudo command on Windows.
|
# NOTE: We don't have the sudo command on Windows.
|
||||||
sudo=""
|
sudo=""
|
||||||
if [ $(id -u) -ne 0 ] && command -v sudo &> /dev/null; then
|
if [ "$(id -u)" -ne 0 ] && command -v sudo &> /dev/null; then
|
||||||
sudo="sudo PATH=${PATH}"
|
sudo="sudo PATH=${PATH}"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
@ -99,7 +99,7 @@ test_setup() {
|
|||||||
# Create containerd in a different process group
|
# Create containerd in a different process group
|
||||||
# so that we can easily clean them up.
|
# so that we can easily clean them up.
|
||||||
keepalive "${sudo} bin/containerd ${CONTAINERD_FLAGS}" \
|
keepalive "${sudo} bin/containerd ${CONTAINERD_FLAGS}" \
|
||||||
${RESTART_WAIT_PERIOD} &> ${report_dir}/containerd.log &
|
"${RESTART_WAIT_PERIOD}" &> "${report_dir}/containerd.log" &
|
||||||
pid=$!
|
pid=$!
|
||||||
set +m
|
set +m
|
||||||
|
|
||||||
@ -122,7 +122,7 @@ test_teardown() {
|
|||||||
# so we can kill both of them by matching the PGID.
|
# so we can kill both of them by matching the PGID.
|
||||||
${sudo} ps | awk "{if (\$3 == ${pid}) print \$1}" | xargs kill
|
${sudo} ps | awk "{if (\$3 == ${pid}) print \$1}" | xargs kill
|
||||||
else
|
else
|
||||||
${sudo} pkill -g $(ps -o pgid= -p ${pid})
|
${sudo} pkill -g $(ps -o pgid= -p "${pid}")
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
@ -131,11 +131,11 @@ test_teardown() {
|
|||||||
# keepalive process is eventually killed in test_teardown.
|
# keepalive process is eventually killed in test_teardown.
|
||||||
keepalive() {
|
keepalive() {
|
||||||
local command=$1
|
local command=$1
|
||||||
echo ${command}
|
echo "${command}"
|
||||||
local wait_period=$2
|
local wait_period=$2
|
||||||
while true; do
|
while true; do
|
||||||
${command}
|
${command}
|
||||||
sleep ${wait_period}
|
sleep "${wait_period}"
|
||||||
done
|
done
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -22,10 +22,13 @@ set -o errexit
|
|||||||
set -o nounset
|
set -o nounset
|
||||||
set -o pipefail
|
set -o pipefail
|
||||||
|
|
||||||
source $(dirname "${BASH_SOURCE[0]}")/build-utils.sh
|
: "${PROJECT:=k8s-cri-containerd}"
|
||||||
source $(dirname "${BASH_SOURCE[0]}")/init-buildx.sh
|
|
||||||
|
basedir="$(dirname "${BASH_SOURCE[0]}")"
|
||||||
|
source "${basedir}/build-utils.sh"
|
||||||
|
source "${basedir}/init-buildx.sh"
|
||||||
cd "${ROOT}"
|
cd "${ROOT}"
|
||||||
|
|
||||||
# ignore errors if the image already exists
|
# ignore errors if the image already exists
|
||||||
make -C integration/images/volume-copy-up push PROJ="gcr.io/${PROJECT:-k8s-cri-containerd}" || true
|
make -C integration/images/volume-copy-up push PROJ="gcr.io/${PROJECT}" || true
|
||||||
make -C integration/images/volume-ownership push PROJ="gcr.io/${PROJECT:-k8s-cri-containerd}" || true
|
make -C integration/images/volume-ownership push PROJ="gcr.io/${PROJECT}" || true
|
||||||
|
@ -20,7 +20,7 @@ ROOT="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"/..
|
|||||||
PROJECT=${PROJECT:-"k8s-cri-containerd"}
|
PROJECT=${PROJECT:-"k8s-cri-containerd"}
|
||||||
|
|
||||||
# GOOGLE_APPLICATION_CREDENTIALS is the path of service account file.
|
# GOOGLE_APPLICATION_CREDENTIALS is the path of service account file.
|
||||||
if [ -z ${GOOGLE_APPLICATION_CREDENTIALS:-""} ]; then
|
if [ -z "${GOOGLE_APPLICATION_CREDENTIALS:-""}" ]; then
|
||||||
echo "GOOGLE_APPLICATION_CREDENTIALS is not set"
|
echo "GOOGLE_APPLICATION_CREDENTIALS is not set"
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
@ -33,6 +33,6 @@ apt-get update
|
|||||||
apt-get install -y libseccomp2 libseccomp-dev
|
apt-get install -y libseccomp2 libseccomp-dev
|
||||||
|
|
||||||
# PULL_REFS is from prow.
|
# PULL_REFS is from prow.
|
||||||
if [ ! -z "${PULL_REFS:-""}" ]; then
|
if [ -n "${PULL_REFS:-""}" ]; then
|
||||||
DEPLOY_DIR=$(echo "${PULL_REFS}" | sha1sum | awk '{print $1}')
|
DEPLOY_DIR=$(echo "${PULL_REFS}" | sha1sum | awk '{print $1}')
|
||||||
fi
|
fi
|
||||||
|
@ -22,7 +22,7 @@ set -o errexit
|
|||||||
set -o nounset
|
set -o nounset
|
||||||
set -o pipefail
|
set -o pipefail
|
||||||
|
|
||||||
source $(dirname "${BASH_SOURCE[0]}")/build-utils.sh
|
source "$(dirname "${BASH_SOURCE[0]}")/build-utils.sh"
|
||||||
cd "${ROOT}"
|
cd "${ROOT}"
|
||||||
|
|
||||||
# Make sure output directory is clean.
|
# Make sure output directory is clean.
|
||||||
@ -35,16 +35,16 @@ BUILDDIR=$(mktemp -d)
|
|||||||
cleanup() {
|
cleanup() {
|
||||||
if [[ ${BUILDDIR} == /tmp/* ]]; then
|
if [[ ${BUILDDIR} == /tmp/* ]]; then
|
||||||
echo "[-] REMOVING ${BUILDDIR}"
|
echo "[-] REMOVING ${BUILDDIR}"
|
||||||
rm -rf ${BUILDDIR}
|
rm -rf "${BUILDDIR}"
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
trap cleanup EXIT
|
trap cleanup EXIT
|
||||||
|
|
||||||
set -x
|
set -x
|
||||||
latest=$(readlink ./releases/cri-cni-containerd.tar.gz)
|
latest=$(readlink ./releases/cri-cni-containerd.tar.gz)
|
||||||
tarball=$(echo ${latest} | sed -e 's/cri-containerd-cni/containerd-cni/g' | sed -e 's/-linux-amd64/.linux-amd64/g')
|
tarball=$(echo "${latest}" | sed -e 's/cri-containerd-cni/containerd-cni/g' | sed -e 's/-linux-amd64/.linux-amd64/g')
|
||||||
cp releases/${latest} ${BUILDDIR}/${tarball}
|
cp "releases/${latest}" "${BUILDDIR}/${tarball}"
|
||||||
cp releases/${latest}.sha256sum ${BUILDDIR}/${tarball}.sha256
|
cp "releases/${latest}.sha256sum" "${BUILDDIR}/${tarball}.sha256"
|
||||||
|
|
||||||
# Push test tarball to Google cloud storage.
|
# Push test tarball to Google cloud storage.
|
||||||
VERSION=$(git describe --match 'v[0-9]*' --dirty='.m' --always)
|
VERSION=$(git describe --match 'v[0-9]*' --dirty='.m' --always)
|
||||||
@ -55,4 +55,4 @@ else
|
|||||||
DEPLOY_DIR="containerd/${DEPLOY_DIR}"
|
DEPLOY_DIR="containerd/${DEPLOY_DIR}"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
PUSH_VERSION=true DEPLOY_DIR=${DEPLOY_DIR} TARBALL=${tarball} VERSION=${VERSION#v} BUILD_DIR=${BUILDDIR} ${ROOT}/test/push.sh
|
PUSH_VERSION=true DEPLOY_DIR=${DEPLOY_DIR} TARBALL=${tarball} VERSION=${VERSION#v} BUILD_DIR=${BUILDDIR} "${ROOT}/test/push.sh"
|
||||||
|
@ -74,7 +74,7 @@ fi
|
|||||||
# Ensure qemu is in binfmt_misc
|
# Ensure qemu is in binfmt_misc
|
||||||
# NOTE: Please always pin this to a digest for predictability/auditability
|
# NOTE: Please always pin this to a digest for predictability/auditability
|
||||||
# Last updated: 08/21/2020
|
# Last updated: 08/21/2020
|
||||||
if [ "$(uname)" == 'Linux' ]; then
|
if [ "$(uname)" = 'Linux' ]; then
|
||||||
docker run --rm --privileged multiarch/qemu-user-static@sha256:c772ee1965aa0be9915ee1b018a0dd92ea361b4fa1bcab5bbc033517749b2af4 --reset -p yes
|
docker run --rm --privileged multiarch/qemu-user-static@sha256:c772ee1965aa0be9915ee1b018a0dd92ea361b4fa1bcab5bbc033517749b2af4 --reset -p yes
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
10
test/push.sh
10
test/push.sh
@ -18,7 +18,7 @@ set -o errexit
|
|||||||
set -o nounset
|
set -o nounset
|
||||||
set -o pipefail
|
set -o pipefail
|
||||||
|
|
||||||
source $(dirname "${BASH_SOURCE[0]}")/utils.sh
|
source "$(dirname "${BASH_SOURCE[0]}")/utils.sh"
|
||||||
|
|
||||||
# DEPLOY_BUCKET is the gcs bucket where the tarball should be stored in.
|
# DEPLOY_BUCKET is the gcs bucket where the tarball should be stored in.
|
||||||
DEPLOY_BUCKET=${DEPLOY_BUCKET:-"cri-containerd-staging"}
|
DEPLOY_BUCKET=${DEPLOY_BUCKET:-"cri-containerd-staging"}
|
||||||
@ -41,7 +41,7 @@ if [[ ! -e ${release_tar} || ! -e ${release_tar_checksum} ]]; then
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
if ! gsutil ls "gs://${DEPLOY_BUCKET}" > /dev/null; then
|
if ! gsutil ls "gs://${DEPLOY_BUCKET}" > /dev/null; then
|
||||||
create_ttl_bucket ${DEPLOY_BUCKET}
|
create_ttl_bucket "${DEPLOY_BUCKET}"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [ -z "${DEPLOY_DIR}" ]; then
|
if [ -z "${DEPLOY_DIR}" ]; then
|
||||||
@ -50,8 +50,8 @@ else
|
|||||||
DEPLOY_PATH="${DEPLOY_BUCKET}/${DEPLOY_DIR}"
|
DEPLOY_PATH="${DEPLOY_BUCKET}/${DEPLOY_DIR}"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
gsutil cp ${release_tar} "gs://${DEPLOY_PATH}/"
|
gsutil cp "${release_tar}" "gs://${DEPLOY_PATH}/"
|
||||||
gsutil cp ${release_tar_checksum} "gs://${DEPLOY_PATH}/"
|
gsutil cp "${release_tar_checksum}" "gs://${DEPLOY_PATH}/"
|
||||||
echo "Release tarball is uploaded to:
|
echo "Release tarball is uploaded to:
|
||||||
https://storage.googleapis.com/${DEPLOY_PATH}/${TARBALL}"
|
https://storage.googleapis.com/${DEPLOY_PATH}/${TARBALL}"
|
||||||
|
|
||||||
@ -60,7 +60,7 @@ if ${PUSH_VERSION}; then
|
|||||||
echo "VERSION is not set"
|
echo "VERSION is not set"
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
echo ${VERSION} | gsutil cp - "gs://${DEPLOY_PATH}/${LATEST}"
|
echo "${VERSION}" | gsutil cp - "gs://${DEPLOY_PATH}/${LATEST}"
|
||||||
echo "Latest version is uploaded to:
|
echo "Latest version is uploaded to:
|
||||||
https://storage.googleapis.com/${DEPLOY_PATH}/${LATEST}"
|
https://storage.googleapis.com/${DEPLOY_PATH}/${LATEST}"
|
||||||
fi
|
fi
|
||||||
|
@ -26,11 +26,11 @@ upload_logs_to_gcs() {
|
|||||||
local -r dir=$2
|
local -r dir=$2
|
||||||
local -r result=$3
|
local -r result=$3
|
||||||
if ! gsutil ls "gs://${bucket}" > /dev/null; then
|
if ! gsutil ls "gs://${bucket}" > /dev/null; then
|
||||||
create_ttl_bucket ${bucket}
|
create_ttl_bucket "${bucket}"
|
||||||
fi
|
fi
|
||||||
local -r upload_log_path=${bucket}/${dir}
|
local -r upload_log_path=${bucket}/${dir}
|
||||||
gsutil cp -r "${result}" "gs://${upload_log_path}"
|
gsutil cp -r "${result}" "gs://${upload_log_path}"
|
||||||
echo "Test logs are uploaed to:
|
echo "Test logs are uploaded to:
|
||||||
http://gcsweb.k8s.io/gcs/${upload_log_path}/"
|
http://gcsweb.k8s.io/gcs/${upload_log_path}/"
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -43,7 +43,7 @@ create_ttl_bucket() {
|
|||||||
gsutil mb "gs://${bucket}"
|
gsutil mb "gs://${bucket}"
|
||||||
local -r bucket_rule=$(mktemp)
|
local -r bucket_rule=$(mktemp)
|
||||||
# Set 30 day TTL for logs inside the bucket.
|
# Set 30 day TTL for logs inside the bucket.
|
||||||
echo '{"rule": [{"action": {"type": "Delete"},"condition": {"age": 30}}]}' > ${bucket_rule}
|
echo '{"rule": [{"action": {"type": "Delete"},"condition": {"age": 30}}]}' > "${bucket_rule}"
|
||||||
gsutil lifecycle set "${bucket_rule}" "gs://${bucket}"
|
gsutil lifecycle set "${bucket_rule}" "gs://${bucket}"
|
||||||
rm "${bucket_rule}"
|
rm "${bucket_rule}"
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user