From 21a5089c2d285d629813b811db381b67bb54e242 Mon Sep 17 00:00:00 2001 From: Dominik Rosiek <58699848+sumo-drosiek@users.noreply.github.com> Date: Tue, 29 Dec 2020 14:19:14 +0100 Subject: [PATCH] Fix template generation (#90) --- src/commands/template | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/commands/template b/src/commands/template index 69b380d6..4b5907a8 100755 --- a/src/commands/template +++ b/src/commands/template @@ -29,8 +29,11 @@ tmpfile="$(mktemp /tmp/values.yaml.XXXXXX)" extra_params='' # Kubectl can take some time before stdin is available for reading # thats why we check if just before it's required -if read -t "${STDIN_WAIT_S}"; then - cat <&0 > "${tmpfile}" +if read -t "${STDIN_WAIT_S}" REPLY; then + # Save first line read from stdin + echo "${REPLY}" > "${tmpfile}" + # Save rest of the stdin + cat <&0 >> "${tmpfile}" extra_params="-f${tmpfile}" fi