mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-26 05:03:09 +00:00
GCS uploads as part of release are now marked public and non-cached by default.
This commit is contained in:
parent
4aac80c9c5
commit
7a2d8fd01a
@ -25,7 +25,10 @@ source hack/config-go.sh
|
|||||||
|
|
||||||
# Incoming options
|
# Incoming options
|
||||||
readonly BUILD_RUN_IMAGES="${BUILD_RUN_IMAGES:-n}"
|
readonly BUILD_RUN_IMAGES="${BUILD_RUN_IMAGES:-n}"
|
||||||
readonly RELEASE_GCS="${RELEASE_GCS:-n}"
|
readonly GCS_RELEASE="${GCS_RELEASE:-n}"
|
||||||
|
readonly GCS_NO_CACHING="${GCS_NO_CACHING:-y}"
|
||||||
|
readonly GCS_MAKE_PUBLIC="${GCS_MAKE_PUBLIC:-y}"
|
||||||
|
|
||||||
|
|
||||||
# Constants
|
# Constants
|
||||||
readonly KUBE_REPO_ROOT="${PWD}"
|
readonly KUBE_REPO_ROOT="${PWD}"
|
||||||
@ -204,7 +207,7 @@ function kube::build::docker_build() {
|
|||||||
|
|
||||||
echo "+++ Building Docker image ${image}. This can take a while."
|
echo "+++ Building Docker image ${image}. This can take a while."
|
||||||
set +e # We are handling the error here manually
|
set +e # We are handling the error here manually
|
||||||
local -r docker_output
|
local docker_output
|
||||||
docker_output=$(${build_cmd} 2>&1)
|
docker_output=$(${build_cmd} 2>&1)
|
||||||
if [[ $? -ne 0 ]]; then
|
if [[ $? -ne 0 ]]; then
|
||||||
set -e
|
set -e
|
||||||
@ -412,7 +415,7 @@ function kube::release::package_full_tarball() {
|
|||||||
# GCS Release
|
# GCS Release
|
||||||
|
|
||||||
function kube::release::gcs::release() {
|
function kube::release::gcs::release() {
|
||||||
[[ "${RELEASE_GCS}" == "y" ]] || return 0
|
[[ "${GCS_RELEASE}" == "y" ]] || return 0
|
||||||
|
|
||||||
kube::release::gcs::verify_prereqs
|
kube::release::gcs::verify_prereqs
|
||||||
kube::release::gcs::ensure_release_bucket
|
kube::release::gcs::ensure_release_bucket
|
||||||
@ -526,6 +529,11 @@ function kube::release::gcs::copy_release_tarballs() {
|
|||||||
# copied. The real way to do this would perhaps to have some sort of release
|
# copied. The real way to do this would perhaps to have some sort of release
|
||||||
# version so that we are never overwriting a destination.
|
# version so that we are never overwriting a destination.
|
||||||
local -r gcs_destination="gs://${KUBE_RELEASE_BUCKET}/${KUBE_RELEASE_PREFIX}"
|
local -r gcs_destination="gs://${KUBE_RELEASE_BUCKET}/${KUBE_RELEASE_PREFIX}"
|
||||||
|
local gcs_options=()
|
||||||
|
|
||||||
|
if [[ ${GCS_NO_CACHING} == "y" ]]; then
|
||||||
|
gcs_options=("-h" "Cache-Control:private, max-age=0")
|
||||||
|
fi
|
||||||
|
|
||||||
echo "+++ Copying client tarballs to ${gcs_destination}"
|
echo "+++ Copying client tarballs to ${gcs_destination}"
|
||||||
|
|
||||||
@ -533,5 +541,11 @@ function kube::release::gcs::copy_release_tarballs() {
|
|||||||
gsutil -q rm -f -R "${gcs_destination}" >/dev/null 2>&1 || true
|
gsutil -q rm -f -R "${gcs_destination}" >/dev/null 2>&1 || true
|
||||||
|
|
||||||
# Now upload everything in release directory
|
# Now upload everything in release directory
|
||||||
gsutil -m cp -r "${RELEASE_DIR}"/* "${gcs_destination}" >/dev/null 2>&1
|
gsutil -m "${gcs_options[@]-}" cp -r "${RELEASE_DIR}"/* "${gcs_destination}" >/dev/null 2>&1
|
||||||
|
|
||||||
|
if [[ ${GCS_MAKE_PUBLIC} == "y" ]]; then
|
||||||
|
gsutil acl ch -R -g all:R "${gcs_destination}" >/dev/null 2>&1
|
||||||
|
fi
|
||||||
|
|
||||||
|
gsutil ls -lh "${gcs_destination}"
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user