Skip to content
Snippets Groups Projects
Unverified Commit 1c5f657f authored by Arthur Outhenin-Chalandre's avatar Arthur Outhenin-Chalandre Committed by GitHub
Browse files

tests/packet-ci: sanitize branch name for kubernetes labels (#10315)


'/' doesn't work in kubernetes label so we replace it.

Signed-off-by: default avatarArthur Outhenin-Chalandre <arthur.outhenin-chalandre@proton.ch>
parent 9613ed87
No related branches found
No related tags found
No related merge requests found
......@@ -6,6 +6,9 @@ vm_cpu_sockets: 1
vm_cpu_threads: 2
vm_memory: 2048Mi
# Replace invalid characters so that we can use the branch name in kubernetes labels
branch_name_sane: "{{ branch | regex_replace('/', '-') }}"
# Request/Limit allocation settings
cpu_allocation_ratio: 0.5
......
......@@ -6,7 +6,7 @@
kind: Namespace
label_selectors:
- cijobs = true
- branch = {{ branch }}
- branch = {{ branch_name_sane }}
register: namespaces
- name: Delete older namespaces
......
......@@ -3,7 +3,7 @@
- name: "Create CI namespace {{ test_name }} for test vms"
shell: |-
kubectl create namespace {{ test_name }} &&
kubectl label namespace {{ test_name }} cijobs=true branch="{{ branch }}" pipeline_id="{{ pipeline_id }}"
kubectl label namespace {{ test_name }} cijobs=true branch="{{ branch_name_sane }}" pipeline_id="{{ pipeline_id }}"
changed_when: false
- name: "Create temp dir /tmp/{{ test_name }} for CI files"
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment