Cirrus: Omit functions in env. file

The `localbenchmarks()` function stores a `.env` file containing current
environment variables for benchmark-classification purposes.  However its
naked use of `printenv` means it was logging the contents of library
functions and (worse) trying to stort all the lines.  This results in an
unusable mess inside `benchmarks.env`.  Fix this by re-using the
purpose-built passthrough_envars() which is designed to only print
useful, safe, env. vars.

Signed-off-by: Chris Evich <cevich@redhat.com>
This commit is contained in:
Chris Evich
2023-02-02 15:43:25 -05:00
parent f099c1fc9a
commit a7db3e8d2c

View File

@ -328,16 +328,19 @@ remove_packaged_podman_files() {
# Execute make localbenchmarks in $CIRRUS_WORKING_DIR/data
# for preserving as a task artifact.
localbenchmarks() {
local datadir
local datadir envnames envname
req_env_vars DISTRO_NV PODBIN_NAME PRIV_NAME TEST_ENVIRON TEST_FLAVOR
req_env_vars VM_IMAGE_NAME EC2_INST_TYPE
datadir=$CIRRUS_WORKING_DIR/data
mkdir -p $datadir
envnames=$(passthrough_envars | sort);
(
echo "# Env. var basis for benchmarks benchmarks."
printenv | grep -Ev "$SECRET_ENV_RE" | sort
for envname in $envnames; do
printf "$envname=%q\n" "${!envname}"
done
echo "# Machine details for data-comparison sake, not actual env. vars."
# Checked above in req_env_vars