Runners are assigned invalid tokens making them unusable in Kubernetes

Summary

Gitlab consistently generates a syntactically invalid Runner token, such as _7jrqB-n, WXgoKxys, or isWPAmQU, making them unusable in Kubernetes

Steps to reproduce

Create a new runner and observe runner token

Example Project

N/A

What is the current bug behavior?

Runners are assigned tokens that have capital letters and other symbols, leading to an error when the runner is to be used:

ERROR: Job failed (system failure): Secret "runner-isWPAmQU-project-82-concurrent-0jmxnf" is invalid: [metadata.generateName: Invalid value: "runner-isWPAmQU-project-82-concurrent-0": a DNS-1123 subdomain must consist of lower case alphanumeric characters, '-' or '.', and must start and end with an alphanumeric character (e.g. 'example.com', regex used for validation is '[a-z0-9]([-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*'), metadata.name: Invalid value: "runner-isWPAmQU-project-82-concurrent-0jmxnf": a DNS-1123 subdomain must consist of lower case alphanumeric characters, '-' or '.', and must start and end with an alphanumeric character (e.g. 'example.com', regex used for validation is '[a-z0-9]([-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*')]

What is the expected correct behavior?

Runners are assigned tokens matching the regular expression above ([a-z0-9]([-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*)

Relevant logs and/or screenshots

ERROR: Job failed (system failure): Secret "runner-isWPAmQU-project-82-concurrent-0jmxnf" is invalid: [metadata.generateName: Invalid value: "runner-isWPAmQU-project-82-concurrent-0": a DNS-1123 subdomain must consist of lower case alphanumeric characters, '-' or '.', and must start and end with an alphanumeric character (e.g. 'example.com', regex used for validation is '[a-z0-9]([-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*'), metadata.name: Invalid value: "runner-isWPAmQU-project-82-concurrent-0jmxnf": a DNS-1123 subdomain must consist of lower case alphanumeric characters, '-' or '.', and must start and end with an alphanumeric character (e.g. 'example.com', regex used for validation is '[a-z0-9]([-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*')]

Runner version is 11.2.0

Output of checks

Results of GitLab environment info

gitlab-env.txt

Results of GitLab application Check

gitlab-check.txt Upload directory permissions are not relevant to the issue

Possible fixes

N/A

Edited Jan 02, 2019 by Zalan Meggyesi
Assignee Loading
Time tracking Loading