1
0
mirror of https://github.com/openshift/installer.git synced 2026-02-05 06:46:36 +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:
W. Trevor King
2018-07-08 14:20:00 -07:00
parent 2aea052782
commit 7af2ce659d
2 changed files with 13 additions and 2 deletions

View File

@@ -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

View File

@@ -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