-
Notifications
You must be signed in to change notification settings - Fork 237
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
K8SPXC-1475 add missing lib for 5.7 backup (#1124)
- Loading branch information
Showing
1 changed file
with
29 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
#!/bin/bash | ||
|
||
set -o errexit | ||
|
||
export AWS_SHARED_CREDENTIALS_FILE='/tmp/aws-credfile' | ||
export AWS_ENDPOINT_URL="${ENDPOINT:-https://s3.amazonaws.com}" | ||
export AWS_REGION="${DEFAULT_REGION:-us-west-2}" | ||
|
||
if [ -n "$VERIFY_TLS" ] && [[ $VERIFY_TLS == "false" ]]; then | ||
AWS_S3_NO_VERIFY_SSL='--no-verify-ssl' | ||
fi | ||
|
||
is_object_exist() { | ||
local bucket="$1" | ||
local object="$2" | ||
|
||
aws $AWS_S3_NO_VERIFY_SSL s3api head-object --bucket $bucket --key "$object" || NOT_EXIST=true | ||
if [[ -z "$NOT_EXIST" ]]; then | ||
return 1 | ||
fi | ||
} | ||
|
||
s3_add_bucket_dest() { | ||
{ set +x; } 2>/dev/null | ||
aws configure set aws_access_key_id "$ACCESS_KEY_ID" | ||
aws configure set aws_secret_access_key "$SECRET_ACCESS_KEY" | ||
set -x | ||
} | ||
|