Fix cache dir detection for docker-windows executor on register
## Summary When user runs `gitlab-runner register --docker-volumes 'c:\\cache:c:\\Users\\ContainerAdministrator'` ## Steps to reproduce <!-- How one can reproduce the issue, such as the job definition, git repository structure. --> 1. `gitlab-runner register --docker-volumes 'c:\\cache:c:\\Users\\ContainerAdministrator\\cache'` 1. Choose `docker-windows` as an exector ## Actual Config <!-- What actually happens --> ```toml [[runners]] name = "windows-2019" url = "xxxxx" token = "xxxxx" executor = "docker-windows" [runners.custom_build_dir] [runners.docker] tls_verify = false image = "alpine:latest" privileged = false disable_entrypoint_overwrite = false oom_kill_disable = false disable_cache = false volumes = ["c:\\cache:c:\\Users\\ContainerAdministrator\\cache"] shm_size = 0 helper_image = "gitlab/gitlab-runner-helper:x86_64-latest" [runners.cache] [runners.cache.s3] [runners.cache.gcs] ``` ## Expected Config <!-- What you should see instead --> ```toml [[runners]] name = "windows-2019" url = "xxxxx" token = "xxxxx" executor = "docker-windows" [runners.custom_build_dir] [runners.docker] tls_verify = false image = "alpine:latest" privileged = false disable_entrypoint_overwrite = false oom_kill_disable = false disable_cache = false volumes = ["c:\\cache:c:\\Users\\ContainerAdministrator\\cache", "c:\\cache"] shm_size = 0 helper_image = "gitlab/gitlab-runner-helper:x86_64-latest" [runners.cache] [runners.cache.s3] [runners.cache.gcs] ``` ## Details For context please read https://gitlab.com/gitlab-org/gitlab-runner/merge_requests/1391, specifically https://gitlab.com/gitlab-org/gitlab-runner/merge_requests/1391#note_177199179. This is because we are not parsing the user specified volumes with src/dst like Linux but doing a simple [string match](https://gitlab.com/gitlab-org/gitlab-runner/blob/b43ecadbd0f59d6b9b4e6ce91519ee50a64904b6/commands/register.go#L133-137). We need to figure out a way to parse the user volume same as we do inside of [docker](https://gitlab.com/gitlab-org/gitlab-runner/blob/20243328bd67c8eca7d8e3af0bdfef729601d691/executors/docker/internal/volumes/parser/windows_parser.go) but without exposing anything from the docker package.
issue