fix: S3 refSvcId=12 — разрешить имя наравне с UUID, версия 5.1.3
This commit is contained in:
@@ -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 != "" {
|
||||
|
||||
Reference in New Issue
Block a user