X-Git-Url: https://gerrit.linuxfoundation.org/infra/gitweb?a=blobdiff_plain;f=shell%2Fcapture-instance-metadata.sh;h=c102d53c3ee67b3f2c0c3010c1d775fd365c89e4;hb=86f276e966e01b037d96a1a87cb6ad1fce18f7cc;hp=a5914ad98bc6fe22bb3aa4f5204191e51c994a6a;hpb=5a6965f43f220bf6002bfde60897afd216f52ab0;p=releng%2Fglobal-jjb.git diff --git a/shell/capture-instance-metadata.sh b/shell/capture-instance-metadata.sh index a5914ad9..c102d53c 100644 --- a/shell/capture-instance-metadata.sh +++ b/shell/capture-instance-metadata.sh @@ -17,6 +17,11 @@ if [ -n "${NOMAD_DC}" ]; then exit 0 fi +if [[ ! -f /run/cloud-init/result.json ]]; then + echo "INFO: Running in unsupported cloud, no metadata" + exit 0 +fi + # AWS not supported, exit cloudtype="$(jq -r .v1.datasource /run/cloud-init/result.json)" if [[ $cloudtype == "DataSourceEc2Local" ]]; then