From 5627280c6ad9edf44afc01cea99881ec5e42a3aa Mon Sep 17 00:00:00 2001 From: Aleksandr Zimin Date: Fri, 6 Dec 2024 01:28:40 +0300 Subject: [PATCH] [controller] Limit the length of label values for `BlockDevice` resources to 63 symbols (#107) Signed-off-by: Aleksandr Zimin Signed-off-by: Alexandr Stefurishin Co-authored-by: Alexandr Stefurishin --- images/agent/src/internal/controller/bd/discoverer.go | 2 ++ 1 file changed, 2 insertions(+) diff --git a/images/agent/src/internal/controller/bd/discoverer.go b/images/agent/src/internal/controller/bd/discoverer.go index 273e4a23..c24d2308 100644 --- a/images/agent/src/internal/controller/bd/discoverer.go +++ b/images/agent/src/internal/controller/bd/discoverer.go @@ -588,6 +588,8 @@ func configureBlockDeviceLabels(blockDevice v1alpha1.BlockDevice) map[string]str } slug.Lowercase = false + slug.MaxLength = 63 + slug.EnableSmartTruncate = false lbls[internal.MetadataNameLabelKey] = slug.Make(blockDevice.ObjectMeta.Name) lbls[internal.HostNameLabelKey] = slug.Make(blockDevice.Status.NodeName) lbls[internal.BlockDeviceTypeLabelKey] = slug.Make(blockDevice.Status.Type)