Do not automatically append "/cache" to docker-volumes if --docker-volumes is given

Open username-removed-474997 requested to merge chr4/gitlab-ci-multi-runner:nocache into master

What does this MR do?

This merge-request removes "/cache" from being automatically added to docker-volumes.

Why was this MR needed?

When specifying a custom directory on the docker host to use for "/cache" e.g. with

gitlab-runner register --docker-volumes /srv/build-cache:/cache:rw

the process will automatically also add "/cache" to the docker-volumes.

This results in the following entry in config.toml

volumes = ["/srv/build-cache:/cache:rw", "/cache"]

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

The change would disrupt deployment processes that rely on "/cache" being automatically set. A non-minor version bump should be considered upon release.

The docker executor documentation in my opinion reads like having to add "/cache" manually is the expected behaviour:

If you modify the /cache storage path, you also need to make sure to mark this directory as persistent by defining it in volumes = ["/my/cache/"] under the [runners.docker] section in config.toml.

Does this MR meet the acceptance criteria?

  • Documentation created/updated
  • Tests
    • Added for this feature/bug
    • All builds are passing
  • Branch has no merge conflicts with master (if you do - rebase it please)