Gitlab Runner (Autoscaler) hosted on Linux can't specify isolation mode for Windows

Summary

A GitLab Runner with the autoscaler executor when hosted on Linux cannot pass Windows-compatible isolation modes to Windows-hosted Docker containers.

Steps to reproduce

  • Configure a GitLab Runner with autoscaler executor.
  • In the [runners.docker] section specify an isolation mode with either isolation = "hyperv" or isolation = "process".
  • Run a job with that runner.

Actual behavior

  • You'll get the error message the isolation value "process" is not valid. the valid values are: 'process', 'hyperv', 'default' and an empty string.

Expected behavior

  • You don't get an error and the job runs

Relevant logs and/or screenshots

image

Possible fixes

Pretty sure the problem is that there is a check for if the isolation is valid here, but that comes from either the windows version or the linux version, which I guess depends just on the binary and therefore the host system.
I don't really know the system (or Go), but I think this might need to be checked manually and not letting it be handled by the docker API.