scripts: add missing quotes, and minor linting issues

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
This commit is contained in:
Sebastiaan van Stijn
2021-07-20 12:06:02 +02:00
parent 0cb656860f
commit dba0ef4eb5
14 changed files with 58 additions and 53 deletions

View File

@@ -26,11 +26,11 @@ upload_logs_to_gcs() {
local -r dir=$2
local -r result=$3
if ! gsutil ls "gs://${bucket}" > /dev/null; then
create_ttl_bucket ${bucket}
create_ttl_bucket "${bucket}"
fi
local -r upload_log_path=${bucket}/${dir}
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}/"
}
@@ -43,7 +43,7 @@ create_ttl_bucket() {
gsutil mb "gs://${bucket}"
local -r bucket_rule=$(mktemp)
# 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}"
rm "${bucket_rule}"