Skip to content

Fix s2i build pipeline: post-setup-actions.sh run only once

Carina Antunes requested to merge fix-s2i into dev10.2-0-pack-fix

s2i jobs are finishing with

mv: can't rename '/tmp/colorbutton': Directory not empty
Connecting to download.ckeditor.com (173.199.183.188:443)
saving to 'panelbutton.zip'
panelbutton.zip 100% |********************************| 1484 0:00:00 ETA
'panelbutton.zip' saved
Archive: panelbutton.zip
inflating: panelbutton/plugin.js
mv: can't rename '/tmp/panelbutton': Directory not empty
Script scripts/post-setup-actions.sh handling the post-update-cmd event returned with error code 1
error: build error: building at STEP "RUN /usr/libexec/s2i/assemble": while running runtime: exit status 1

Upon inspection seems the scripts/post-setup-actions.sh were running 3x, and the outcome of the mv command is not determinist. It creates a folder and moves content if not found, a second run will move the folder inside the existing folder, a 3rd run will result in the error above.

A quick fix is to check if they already created one of the needed folders; the permanent fix I suggest is to remove the action from post update.

Edited by Carina Antunes

Merge request reports