Truncate image version label so that it avoids the 63 char k8s limit

Signed-off-by: Christian M. Adams <chadams@redhat.com>
This commit is contained in:
Christian M. Adams
2021-12-16 14:05:08 -05:00
parent 35062157e0
commit 345738cba3

View File

@@ -7,7 +7,7 @@ metadata:
namespace: '{{ ansible_operator_meta.namespace }}'
labels:
app.kubernetes.io/name: '{{ ansible_operator_meta.name }}'
app.kubernetes.io/version: '{{ _image_version }}'
app.kubernetes.io/version: '{{ _image.split(':')[-1] | truncate(63, True, '') }}'
app.kubernetes.io/part-of: '{{ ansible_operator_meta.name }}'
app.kubernetes.io/managed-by: '{{ deployment_type }}-operator'
app.kubernetes.io/component: '{{ deployment_type }}'
@@ -23,7 +23,7 @@ spec:
metadata:
labels:
app.kubernetes.io/name: '{{ ansible_operator_meta.name }}'
app.kubernetes.io/version: '{{ _image_version }}'
app.kubernetes.io/version: '{{ _image.split(':')[-1] | truncate(63, True, '') }}'
app.kubernetes.io/part-of: '{{ ansible_operator_meta.name }}'
app.kubernetes.io/managed-by: '{{ deployment_type }}-operator'
app.kubernetes.io/component: '{{ deployment_type }}'