Skip to content

Print CI_JOB_IMAGE inside container if present for executor image

What does this MR do?

it modifies one of the opening print statements of a kubernetes build container to use the Defined ENV Variable if it is present instead of the pre defined value

Why was this MR needed?

I made a kubernetes admission controller to automatically change the image of open source containers to instead use internal proxy cache's inside of harbor depending on the source, thus not bothering our users by avoiding forcing them to abide by whitelists. for example everyone wants to write "alpine" on jobs and not "harbor.my.company.domain.com/dockerhub-cache/library/alpine"

My admission controller also modifies the CI_JOB_IMAGE variable to reflect the correct value and it would make sense as a reserved keyword that it would be used when presenting the information to the user of what image is being executed.

Currently i have to pre script a custom echo that also asks to ignore the other mention of what image is being executed

What's the best way to test this MR?

validate the env variable is used at the start of builds and if not present falls back to existing hardcode via shell parameter expansion

What are the relevant issue numbers?

None made

Merge request reports