CI: Code quality - unable to resolve docker endpoint: open /certs/client/ca.pem: no such file or directory

Summary

Since the usage of the latest gitlab-runner 14.4.0 release, the "Code Quality" job crashes with the following error:

unable to resolve docker endpoint: open /certs/client/ca.pem: no such file or directory

Complete job trace:

Running with gitlab-runner 14.4.0 (4b9e985a)
  on company-internal-runner zumR2BYp
Resolving secrets 00:00
Preparing the "kubernetes" executor 00:00
Using Kubernetes namespace: gitlab-runner-internal
Using Kubernetes executor with image docker:19.03.12 ...
Using attach strategy to execute scripts...
Preparing environment 00:06
Waiting for pod gitlab-runner-internal/runner-zumr2byp-project-14313986-concurrent-08zrzd to be running, status is Pending
Waiting for pod gitlab-runner-internal/runner-zumr2byp-project-14313986-concurrent-08zrzd to be running, status is Pending
	ContainersNotReady: "containers with unready status: [build helper svc-0]"
	ContainersNotReady: "containers with unready status: [build helper svc-0]"
Running on runner-zumr2byp-project-14313986-concurrent-08zrzd via gitlab-runner-gitlab-runner-58d7b9d997-xnhpw...
Getting source from Git repository 00:03
Fetching changes with git depth set to 50...
Initialized empty Git repository in /builds/zumR2BYp/0/company/ci/.git/
Created fresh repository.
Checking out 5fff904f as refs/merge-requests/156/head...
Skipping Git submodules setup
Executing "step_script" stage of the job script 00:00
$ export SOURCE_CODE=$PWD
$ if ! docker info &>/dev/null; then # collapsed multi-line command
$ function propagate_env_vars() { # collapsed multi-line command
$ docker pull --quiet "$CODE_QUALITY_IMAGE"
unable to resolve docker endpoint: open /certs/client/ca.pem: no such file or directory
Uploading artifacts for failed job 00:01
Uploading artifacts...
WARNING: gl-code-quality-report.json: no matching files 
ERROR: No files to upload                          
Cleaning up project directory and file based variables 00:00
ERROR: Job failed: command terminated with exit code 1

Possible fixes

This looks to be caused by the DOCKER_TLS_CERTDIR that is override on that job, changing the original runner configuration.

We may override it again:

include:
  - remote: https://gitlab.com/gitlab-org/gitlab-foss/-/raw/14-6-stable/lib/gitlab/ci/templates/Jobs/Code-Quality.gitlab-ci.yml

code_quality:
  variables:
    DOCKER_TLS_CERTDIR: /certs
  stage: verify
  rules:
    - if: $NEXY_CI_STAGE_VERIFY != "1" || $CODE_QUALITY_DISABLED
      when: never
    - if: $CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH
    - if: $CI_MERGE_REQUEST_IID

However, we should not have to change this configuration here.

I propose to remove the variable override from this job.