Skip to content

Commit 8a6ef64

Browse files
Fix SIGPIPE error in mirror-plugins.sh when using --from-dir (#2263)
The grep | head pipeline causes SIGPIPE (exit 141) when head closes the pipe after reading one line while grep is still writing. With set -eo pipefail, this causes the script to exit silently. Adding '|| true' prevents the pipeline failure from terminating the script. Signed-off-by: Fortune-Ndlovu <fndlovu@redhat.com> Co-authored-by: Fortune-Ndlovu <fndlovu@redhat.com>
1 parent 7a9cfa8 commit 8a6ef64

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

.rhdh/scripts/mirror-plugins.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -842,7 +842,7 @@ function mirror_plugins_from_dir() {
842842
if [[ -f "$existing_summary" ]] && [[ -d "${FROM_DIR}/catalog-index" ]]; then
843843
# Look for catalog index mapping in summary (format: "oci://...plugin-catalog-index:... → ...")
844844
local original_url
845-
original_url=$(grep "plugin-catalog-index" "$existing_summary" | head -n1 | sed -E 's/^(oci:[^ ]+).*/\1/')
845+
original_url=$(grep "plugin-catalog-index" "$existing_summary" | head -n1 | sed -E 's/^(oci:[^ ]+).*/\1/' || true)
846846
if [[ -n "$original_url" ]]; then
847847
PLUGIN_INDEX="$original_url"
848848
debugf "Restored original catalog index URL: $PLUGIN_INDEX"

0 commit comments

Comments
 (0)