ROX-27350: Fix task execution by removing dnf upgrade
from tasks
#9
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
I was a bit too quick to switch images in task steps from UBI8 to UBI9 in #3. Where 8 felt ok, 9 started failing because of the
dnf upgrade
command.E.g. in this run https://console.redhat.com/application-pipeline/workspaces/rh-acs/applications/acs/pipelineruns/scanner-db-on-push-9qsrm
![image](https://private-user-images.githubusercontent.com/537715/396898599-2300eecf-b6a3-4d89-a463-dcf04d0131be.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3Mzk0MTAxNzMsIm5iZiI6MTczOTQwOTg3MywicGF0aCI6Ii81Mzc3MTUvMzk2ODk4NTk5LTIzMDBlZWNmLWI2YTMtNGQ4OS1hNDYzLWRjZjA0ZDAxMzFiZS5wbmc_WC1BbXotQWxnb3JpdGhtPUFXUzQtSE1BQy1TSEEyNTYmWC1BbXotQ3JlZGVudGlhbD1BS0lBVkNPRFlMU0E1M1BRSzRaQSUyRjIwMjUwMjEzJTJGdXMtZWFzdC0xJTJGczMlMkZhd3M0X3JlcXVlc3QmWC1BbXotRGF0ZT0yMDI1MDIxM1QwMTI0MzNaJlgtQW16LUV4cGlyZXM9MzAwJlgtQW16LVNpZ25hdHVyZT1iNWFiNjBjZjBhMWU5YjM5MWFlNmU1MGYxZjBjYzA4YzdhM2ZkZjIyYTAxOTljODIxNmFhMzE0NGEyYTJlZjhiJlgtQW16LVNpZ25lZEhlYWRlcnM9aG9zdCJ9.exkn6cQaOFIkxyDgJWHkDbgT5pHSHIusx0S894bxNe0)
From the task log:
Here the upgrade of
shadow-utils
fails because it cannot overwrite/usr/bin/newgidmap
(that's despite the container being executed as root). My scientific guess (guessing because the proper repro will take a couple hours I don't really want to invest in it) after reading this issue is that there's some special restriction on/usr/bin/newgidmap
due to how Konflux/Tekton executes task steps. This restriction results in the error during theshadow-utils
upgrade attempt. We've not seen this on 8 because likely there were just noshadow-utils
upgrades there.We don't actually need
dnf upgrade
for proper functioning of our tasks and the (relative) freshness of packages will be ensured by Renovate updating base images. Hence, my suggestion is to stopdnf upgrade
-ing in tasks.Testing
Used bundle from this PR in stackrox/scanner#1742 and our custom tasks succeeded there.