Uploaded image for project: 'Jenkins'
  1. Jenkins
  2. JENKINS-64306

Unable to create pod - metadata.labels: Invalid value

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: Minor Minor
    • kubernetes-plugin
    • 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={}).

        

            Unassigned Unassigned
            ziouf Cyril Marin
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated: