From 945339362fbe7f7e8de2f627de814679ad4c1b35 Mon Sep 17 00:00:00 2001 From: James Davies Date: Wed, 12 Nov 2014 16:56:50 +1000 Subject: [PATCH 1/2] Strip extra '-' from md5sum output when creating S3 bucket md5sum prints out the hash, followed by the filename. When piped in from stdin, this equates to a '-' character. cluster/aws/util.sh was incorrect including this '-' character as part of the S3 bucket name, causing the script to fail on Linux machines with the md5sum binary. i.e. "s3://kubernetes-staging-0ac68d8c77915cc1069a9e2f5e1f1d2d -" Fixed by using `awk` to return only the first column (up to the space) --- cluster/aws/util.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cluster/aws/util.sh b/cluster/aws/util.sh index dd5a2de64be..06c2012c238 100644 --- a/cluster/aws/util.sh +++ b/cluster/aws/util.sh @@ -162,7 +162,7 @@ function upload-server-tars() { if which md5 > /dev/null 2>&1; then project_hash=$(md5 -q -s "${USER} ${key}") else - project_hash=$(echo -n "${USER} ${key}" | md5sum) + project_hash=$(echo -n "${USER} ${key}" | md5sum | awk '{ print $1 }') fi local -r staging_bucket="kubernetes-staging-${project_hash}" From ff5a425b67f8ccdf7000a10bd70d73ce8de5d3d2 Mon Sep 17 00:00:00 2001 From: James Davies Date: Wed, 12 Nov 2014 17:04:01 +1000 Subject: [PATCH 2/2] Strip extra '-' from md5sum output when creating GCE projects --- cluster/gce/util.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cluster/gce/util.sh b/cluster/gce/util.sh index 0ae59f74513..7df13959b6a 100755 --- a/cluster/gce/util.sh +++ b/cluster/gce/util.sh @@ -106,7 +106,7 @@ function upload-server-tars() { if which md5 > /dev/null 2>&1; then project_hash=$(md5 -q -s "$PROJECT") else - project_hash=$(echo -n "$PROJECT" | md5sum) + project_hash=$(echo -n "$PROJECT" | md5sum | awk '{ print $1 }') fi project_hash=${project_hash:0:5}