common: Don't export COREOS_BUILD_ID

5a76e4e5e9027443ef2014d8e1d06e9baa9e50aa started exporting COREOS_BUILD_ID
whenever it was found in version.txt, even if its value was blank. Because
COREOS_BUILD_ID is in ENVIRONMENT_WHITELIST, this caused generated build IDs
to be propagated into the SDK chroot environment and reused for every build
in a "cork enter" session. Stop exporting COREOS_BUILD_ID when we set it
ourselves.

See also 8e754f9c2bd4b4ec6561613ff57c095886877960.
This commit is contained in:
Benjamin Gilbert 2017-04-06 12:23:51 -07:00
parent 66dca6ab85
commit 3e27bdcc45

View File

@ -296,6 +296,10 @@ if [[ -f "${REPO_MANIFESTS_DIR}/version.txt" ]]; then
else
load_environment_var "${REPO_MANIFESTS_DIR}/version.txt" \
COREOS_VERSION_ID COREOS_BUILD_ID COREOS_SDK_VERSION
# Don't promote COREOS_BUILD_ID into an environment variable when it
# didn't start as one, since we don't want it leaking into the SDK
# chroot environment via ENVIRONMENT_WHITELIST.
declare +x COREOS_BUILD_ID
fi
: ${COREOS_BUILD_ID:=$(date +%Y-%m-%d-%H%M)}
elif [[ -f "${SCRIPT_LOCATION}/version.txt" ]]; then