actions / runner-container-hooks

Runner Container Hooks for GitHub Actions
MIT License
67 stars 43 forks source link

Improve error message/handling of missing permissions with custom container #102

Closed john-zielke-snkeos closed 8 months ago

john-zielke-snkeos commented 11 months ago

What would you like added?

When the ARC executes a job when using the kubernetes job mode, it should check if the pod fails with a ImagePullBackOff, fail the run and write a appropriate error message. And especially in the case of a image on ghcr.io and the ImagePullBackOff happening because of a 403 error, it should provide a hint to the user to make sure his workflows have the appropriate permissions to access the image.

Why is this needed?

When using images hosted on ghcr.io in your own org, you need to have appropriate permissions to access them. This means both configuring the repo hosting the image with the proper visibility/permissions. This needs to be done once. More importantly any workflows using these images (i.e. packages) as the container for a build step, need to have the package: read permission. This is probably not obvious to every user and while it is enabled by default for most cases, if you specify any permissions for the job manually, none of the defaults apply anymore and they would have to be added manually to your specified permissions.

With the current implementation, the user will not get any useful error message and instead the job will keep waiting for 10 minutes before failing without a useful error message.

image
github-actions[bot] commented 11 months ago

Hello! Thank you for filing an issue.

The maintainers will triage your issue shortly.

In the meantime, please take a look at the troubleshooting guide for bug reports.

If this is a feature request, please review our contribution guidelines.

nikola-jokic commented 11 months ago

Hey @john-zielke-snkeos,

I transferred the issue here, since the ARC is not responsible for the hook execution. This is a more appropriate place for this issue. Thank you for reporting it!