Skip to content

Add volume cache

What does this MR do?

"volume" cache adapter has been added. It disallows downloading and uploading cached files from a server, instead one can specify --cache-type volume flag for register command along with volume parameters and they will be converted into a volume specification for kubernetes runner.

Why was this MR needed?

When installing gitlab-runner Helm chart on bare-metal k8s cluster it's somewhat tricky to specify (even non-shared) cache. There are some workarounds like echoing volume settings into config.toml in the entrypoint script (see #4178 (closed)) but they are fragile and I'd rather not use them.

Are there points in the code the reviewer needs to double check?

  • RunnerConfig.Cache.Volume settings are converted into k8s volume on register. I don't know if it would be better to add cache volume when creating worker pod.
  • serializing RunnerConfig.Cache.Volume into config.toml is redundant. I don't know how to disable it.

Does this MR meet the acceptance criteria?

  • Documentation created/updated
  • Added tests for this feature/bug
  • In case of conflicts with master - branch was rebased

What are the relevant issue numbers?

#4178 (closed)

Merge request reports