Skip to content

Add Kubernetes pod label sanitization

What does this MR do?

Adding sanitation for kubernetes labels to avoid issues with non conformative variables. executorkubernetes

Why was this MR needed?

Currently the user needs to be careful when declaring variables in the Kubernetes labels. Such labels may not conform with the restrictions for Labels in Kubernetes which will result in a failing pipeline.

What's the best way to test this MR?

Add the following configuration to a kubernetes executor:

        [runners.kubernetes.pod_labels]
        forbidden_label = "@Hello world this value is not valid--"
        job_name = "${CI_JOB_NAME}"

The job_name can illustrate one of the possible usages.

What are the relevant issue numbers?

Closes #4565 (closed)

Edited by Arran Walker

Merge request reports