mirror of
https://github.com/openshift/installer.git
synced 2026-02-05 15:47:14 +01:00
scripts/maintenance: Dependency checks for tag-aws.sh and clean-aws.sh
Following the pattern set by tag-route53-hosted-zones.sh. I'm also following tag-route53-hosted-zones.sh in not testing for any POSIX commands we use, although it would be easy to add tests for them as well if we wanted.
This commit is contained in:
@@ -4,6 +4,7 @@ usage() {
|
||||
cat <<EOF
|
||||
|
||||
$(basename "$0") deletes AWS resources tagged with tags specified in a tag file.
|
||||
Requires that 'docker' and 'jq' are installed.
|
||||
|
||||
AWS_ACCESS_KEY_ID and AWS_SECRET_ACCESS_KEY environmental variables must be set.
|
||||
|
||||
@@ -92,6 +93,11 @@ while [ $# -gt 0 ]; do
|
||||
shift
|
||||
done
|
||||
|
||||
if ! command -V docker >/dev/null || ! command -V jq >/dev/null; then
|
||||
echo "Missing required dependencies" >&2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if [ -n "$AWS_REGION" ]; then
|
||||
region="${AWS_REGION:-}"
|
||||
fi
|
||||
|
||||
@@ -5,8 +5,8 @@ usage() {
|
||||
|
||||
$(basename "$0") tags AWS resources with 'expirationDate: some-date-string',
|
||||
defaulting to the following days' date, and excludes all resources tagged with
|
||||
tag keys/values specified in an 'exclude' file. Requires that both 'jq' and the
|
||||
AWS CLI are installed.
|
||||
tag keys/values specified in an 'exclude' file. Requires that 'docker' is
|
||||
installed.
|
||||
|
||||
AWS_ACCESS_KEY_ID and AWS_SECRET_ACCESS_KEY environmental variables must be set.
|
||||
|
||||
@@ -107,6 +107,11 @@ while [ $# -gt 0 ]; do
|
||||
shift
|
||||
done
|
||||
|
||||
if ! command -V docker >/dev/null; then
|
||||
echo "Missing required dependencies" >&2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if [ -n "$AWS_REGION" ]; then
|
||||
region="${AWS_REGION:-}"
|
||||
fi
|
||||
|
||||
Reference in New Issue
Block a user