Skip to content

Commit 7b77e6e

Browse files
committed
cmd-build-with-buildah: fix use of uninitialized var
I had thought since this was under an if conditional that validates the value was non-zero then it would be OK to not provide a default value for it here too, but in this case the var gets evaluated when written to the file (via the heredoc/EOF) so it does matter. Fixes 8a4f404
1 parent 8a4f404 commit 7b77e6e

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/cmd-build-with-buildah

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -223,7 +223,7 @@ build_with_buildah() {
223223
set -euxo pipefail
224224
if [ -n "${REGISTRY_AUTH_FILE:-}" ]; then
225225
# Since we are changing dirs below let's make it an absolute path
226-
export REGISTRY_AUTH_FILE=\$(readlink -f "${REGISTRY_AUTH_FILE}")
226+
export REGISTRY_AUTH_FILE=\$(readlink -f "${REGISTRY_AUTH_FILE:-}")
227227
fi
228228
env -C ${tempdir}/src TMPDIR=$(realpath cache) buildah $@
229229
skopeo copy --quiet "${final_ref}" "${tmp_oci_archive}"

0 commit comments

Comments
 (0)