Merge pull request #115634 from ameukam/e2e-hardcode-bucket-logs-location

Add retention policy to staging buckets
This commit is contained in:
Kubernetes Prow Robot 2023-03-01 12:39:18 -08:00 committed by GitHub
commit 94424ba808
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -326,16 +326,14 @@ function upload-tars() {
local node_binary_tar_urls=()
for region in "${PREFERRED_REGION[@]}"; do
retention_period="1d" # https://cloud.google.com/storage/docs/bucket-lock#retention-periods
suffix="-${region}"
if [[ "${suffix}" == "-us-central1" ]]; then
suffix=""
fi
local staging_bucket="gs://kubernetes-staging-${project_hash}${suffix}"
# Ensure the buckets are created
if ! gsutil ls "${staging_bucket}" >/dev/null; then
echo "Creating ${staging_bucket}"
gsutil mb -l "${region}" -p "${PROJECT}" "${staging_bucket}"
gsutil mb -l "${region}" -p "${PROJECT}" --retention "${retention_period}" "${staging_bucket}"
fi
local staging_path="${staging_bucket}/${INSTANCE_PREFIX}-devel"