The condition in the commit
31a4b7fc00fe90494b6efb512ad0f1db02481ff3
should instead check when the environment variable $NOMAD_DC is not
defined or unset, this avoids the script from exiting without capturing
instance metadata.
Issue: RELENG-3142
Change-Id: I80240d77abfacb59c81e41e63629468350e24b7b
Signed-off-by: Anil Belur <abelur@linuxfoundation.org>
--- /dev/null
+---
+fixes:
+ - |
+ Check condition when ${NOMAD_DC} is undefined or unset
+
+ Check if the environment variable $NOMAD_DC is not defined or unset,
+ this avoids the script from exiting without capturing instance
+ metadata.
echo "---> capture-instance-metadata.sh"
# detect if we're in EC2
-if [ -z "${NOMAD_DC}" ]; then
+if [ -n "${NOMAD_DC}" ]; then
echo "INFO: Running in Nomad, no metadata"
exit 0
fi