Merge pull request #30912 from mwl/fix/aws-multicluster-per-region

Automatic merge from submit-queue

Added INSTANCE_PREFIX to project hash to avoid S3 bucket clash

**What this PR does / why we need it**:
Fixes an issue where if you run multiple k8s clusters in same region S3 resources are being overwritten and therefore node bootstrapping stalls, i.e. when using Auto scaling.

**Special notes for your reviewer**:
By adding the `INSTANCE_PREFIX` to the project hash in the S3 bucket the bucket will not be overwritten.

**Release note**:
<!--  Steps to write your release note:
1. Use the release-note-* labels to set the release note state (if you have access) 
2. Enter your extended release note in the below block; leaving it blank means using the PR title as the release note. If no release note is required, just write `NONE`. 
-->
```release-note
```
pull/6/head
Kubernetes Submit Queue 2016-10-16 09:10:43 -07:00 committed by GitHub
commit 712d3d2cd3
1 changed files with 2 additions and 2 deletions

View File

@ -609,9 +609,9 @@ function upload-server-tars() {
local project_hash=
local key=$(aws configure get aws_access_key_id)
if which md5 > /dev/null 2>&1; then
project_hash=$(md5 -q -s "${USER} ${key}")
project_hash=$(md5 -q -s "${USER} ${key} ${INSTANCE_PREFIX}")
else
project_hash=$(echo -n "${USER} ${key}" | md5sum | awk '{ print $1 }')
project_hash=$(echo -n "${USER} ${key} ${INSTANCE_PREFIX}" | md5sum | awk '{ print $1 }')
fi
AWS_S3_BUCKET="kubernetes-staging-${project_hash}"
fi