shortToken containing underscore makes GCP instance name invalid
Hi,
I am testing the autoscaler in our gitlab instance. My runner runs is a kubernetes pod from gitlab-runner chart to provisions GCP instances.
I noticed that the name of the GCP instance is based on the runner short token, such as runner-[shortToken]-[vm tag]-[random string]
Most of the time, it works.
However, one of the runner I ran had the shortToken yuR29_3t
, ie with a _
, which failed in GCP API call as invalid name :
googleapi: Error 400: Invalid value for field 'resource.name': 'runner-yur29_3t-wsrm-fd0e4ce801ce229cc59b'. Must be a match of regex '(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?)'
Restarting the pod was ok because it regenerated a short token without the underscore
I understand that the shortToken is used to identity the parent runner but removing the invalid characters from the shortToken will make the autoscaler more reliable
Edited by Romain Chalumeau