fix: S3 refSvcId=12 — разрешить имя наравне с UUID, версия 5.1.3

This commit is contained in:
Naeel
2026-07-18 13:33:59 +03:00
parent 0f82e08e81
commit ab7ab7abf2
3 changed files with 2 additions and 23 deletions
@@ -453,9 +453,6 @@ func isValidRefValue(options []core.RefServiceInstanceOption, refSvcId int, valu
if strings.EqualFold(strings.TrimSpace(opt.InstanceUID), value) {
return true
}
if refSvcId == 12 {
continue
}
if strings.EqualFold(strings.TrimSpace(opt.DisplayName), value) {
return true
}
@@ -465,21 +462,12 @@ func isValidRefValue(options []core.RefServiceInstanceOption, refSvcId int, valu
func formatRefOptions(options []core.RefServiceInstanceOption, refSvcId int, limit int) string {
if len(options) == 0 {
if refSvcId == 12 {
return "требуется UUID существующего инстанса"
}
return "список пуст"
}
formatted := make([]string, 0, len(options))
for _, opt := range options {
uid := strings.TrimSpace(opt.InstanceUID)
name := strings.TrimSpace(opt.DisplayName)
if refSvcId == 12 {
if uid != "" {
formatted = append(formatted, uid)
}
continue
}
if name != "" && uid != "" {
formatted = append(formatted, name+" ("+uid+")")
} else if uid != "" {