mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-08-07 19:23:40 +00:00
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)
This commit is contained in:
parent
797c499b59
commit
945339362f
@ -162,7 +162,7 @@ function upload-server-tars() {
|
|||||||
if which md5 > /dev/null 2>&1; then
|
if which md5 > /dev/null 2>&1; then
|
||||||
project_hash=$(md5 -q -s "${USER} ${key}")
|
project_hash=$(md5 -q -s "${USER} ${key}")
|
||||||
else
|
else
|
||||||
project_hash=$(echo -n "${USER} ${key}" | md5sum)
|
project_hash=$(echo -n "${USER} ${key}" | md5sum | awk '{ print $1 }')
|
||||||
fi
|
fi
|
||||||
local -r staging_bucket="kubernetes-staging-${project_hash}"
|
local -r staging_bucket="kubernetes-staging-${project_hash}"
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user