-
Bug
-
Resolution: Unresolved
-
Minor
-
None
-
- Jenkins 2.235.5
- Kubernetes jenkins plugin 1.27.7
- Openshift 4.5.16
I am facing the following error when I try to build a Gitlab OrganizationFolder project branch containing a '/' character in it's name.
Like "feature/adding-something"
Pod label sanitization seem not working.
FYI I only have obfuscated sensible data
ERROR: Unable to create pod my-namespace/my-namespace-project-
2f-project-api-release-2f0.2.3-3-frsw-p7zls. Failure executing: POST at: https://172.30.0.1/api/v1/namespaces/my-namespace/pods. Message: Pod "my-namespace-project2f-project-api-release-2f0.2.3-3-frsw-p7zls" is invalid: metadata.labels: Invalid value: "release%2F0.2.3-3": a valid label must be an empty string or consist of alphanumeric characters, '', '' or '.', and must start and end with an alphanumeric character (e.g. 'MyValue', or 'my_value', or '12345', regex used for validation is '(([A-Za-z0-9][-A-Za-z0-9_.])?[A-Za-z0-9])?'). Received status: Status(apiVersion=v1, code=422, details=StatusDetails(causes=[StatusCause(field=metadata.labels, message=Invalid value: "release%2F0.2.3-3": a valid label must be an empty string or consist of alphanumeric characters, '', '' or '.', and must start and end with an alphanumeric character (e.g. 'MyValue', or 'my_value', or '12345', regex used for validation is '(([A-Za-z0-9][-A-Za-z0-9_.])?[A-Za-z0-9])?'), reason=FieldValueInvalid, additionalProperties={})], group=null, kind=Pod, name=my-namespace-project2f-project-api-release-2f0.2.3-3-frsw-p7zls, retryAfterSeconds=null, uid=null, additionalProperties={}), kind=Status, message=Pod "my-namespace-project2f-project-api-release-2f0.2.3-3-frsw-p7zls" is invalid: metadata.labels: Invalid value: "release%2F0.2.3-3": a valid label must be an empty string or consist of alphanumeric characters, '', '_' or '.', and must start and end with an alphanumeric character (e.g. 'MyValue', or 'my_value', or '12345', regex used for validation is '(([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9])?'), metadata=ListMeta(_continue=null, remainingItemCount=null, resourceVersion=null, selfLink=null, additionalProperties={}), reason=Invalid, status=Failure, additionalProperties={}).
Can't reproduce using the git branch source on a multibranch project, with a branch containing a /. Inspection of the current code doesn't show any problem that could prevent % from being sanitized when applying built-in labels. Could it be something in your pod template declaration ?