mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-08-02 08:17:26 +00:00
Don't blindly delete stuff on GCS
This commit is contained in:
parent
0cc03f7433
commit
df844e3b44
@ -242,7 +242,7 @@ function kube::build::ensure_golang() {
|
|||||||
kube::build::docker_image_exists golang 1.3 || {
|
kube::build::docker_image_exists golang 1.3 || {
|
||||||
[[ ${KUBE_SKIP_CONFIRMATIONS} =~ ^[yY]$ ]] || {
|
[[ ${KUBE_SKIP_CONFIRMATIONS} =~ ^[yY]$ ]] || {
|
||||||
echo "You don't have a local copy of the golang docker image. This image is 450MB."
|
echo "You don't have a local copy of the golang docker image. This image is 450MB."
|
||||||
read -p "Download it now? [y/n] " -n 1 -r
|
read -p "Download it now? [y/n] " -r
|
||||||
echo
|
echo
|
||||||
[[ $REPLY =~ ^[yY]$ ]] || {
|
[[ $REPLY =~ ^[yY]$ ]] || {
|
||||||
echo "Aborting." >&2
|
echo "Aborting." >&2
|
||||||
@ -730,7 +730,18 @@ function kube::release::gcs::copy_release_artifacts() {
|
|||||||
echo "+++ Copying release artifacts to ${gcs_destination}"
|
echo "+++ Copying release artifacts to ${gcs_destination}"
|
||||||
|
|
||||||
# First delete all objects at the destination
|
# First delete all objects at the destination
|
||||||
gsutil -q rm -f -R "${gcs_destination}" >/dev/null 2>&1 || true
|
if gsutil ls "${gcs_destination}" >/dev/null 2>&1; then
|
||||||
|
echo "!!! ${gcs_destination} not empty."
|
||||||
|
read -p "Delete everything under ${gcs_destination}? [y/n] " -r || {
|
||||||
|
echo "EOF on prompt. Skipping upload"
|
||||||
|
return
|
||||||
|
}
|
||||||
|
[[ $REPLY =~ ^[yY]$ ]] || {
|
||||||
|
echo "Skipping upload"
|
||||||
|
return
|
||||||
|
}
|
||||||
|
gsutil -m rm -f -R "${gcs_destination}"
|
||||||
|
fi
|
||||||
|
|
||||||
# Now upload everything in release directory
|
# Now upload everything in release directory
|
||||||
gsutil -m "${gcs_options[@]+${gcs_options[@]}}" cp -r "${RELEASE_DIR}"/* "${gcs_destination}"
|
gsutil -m "${gcs_options[@]+${gcs_options[@]}}" cp -r "${RELEASE_DIR}"/* "${gcs_destination}"
|
||||||
|
Loading…
Reference in New Issue
Block a user