Add pull-policy support for images
Steps
Step | Status |
---|---|
1. Runner: Implement allowed_pull_policies in config.toml | gitlab-runner!3422 (merged) |
2. Runner: Implement supporting pull_policy from jobs | gitlab-runner!3412 (merged) |
3. GitLab: Add pull-policy support for images |
|
4. Runner: Add image pull-policy support to services | gitlab-runner!3488 (closed) |
5. GitLab: Add pull-policy support for service images on CI config | !90136 (merged) |
6. Runner: Add the pull-policy from jobs support to Kubernetes | gitlab-runner!3504 (merged) |
What does this MR do and why?
This MR implements the support of accepting pull_policy
from CI config and sending it to Runner.
pull_policy
can be either a string or an array of strings. More detail: https://docs.gitlab.com/runner/executors/docker.html#using-multiple-pull-policies
Notes:
- Related to #21619 (closed)
- It's behind a feature flag
ci_docker_image_pull_policy
(#363186 (closed)). - In order to make this work, gitlab-runner!3422 (merged) and gitlab-runner!3412 (merged) are required.
- I guess we can merge this without the Runner work since this is behind a feature flag. WDYT?
Future works:
- E2E test
- Supporting not only images but also services
Screenshots or screen recordings
When you define a CI config;
image:
name: ruby:2.7.6-alpine
test:
script: ruby -v
This is the default behavior:
Now you can define a pull_policy
:
image:
name: ruby:2.7.6-alpine
pull_policy: if-not-present
test:
script: ruby -v
If the Runner does not allow the pull policy (allowed_pull_policies
, gitlab-runner!3422 (merged))
MR acceptance checklist
This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.
-
I have evaluated the MR acceptance checklist for this MR.
Edited by Furkan Ayhan