fix: move s3Uid resolve before early return when no refSvcId
This commit is contained in:
@@ -2,7 +2,7 @@ terraform {
|
||||
required_providers {
|
||||
nubes = {
|
||||
source = "registry.kube5s.ru/nubes-test/nubes"
|
||||
version = "5.1.8"
|
||||
version = "5.1.9"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -4,7 +4,7 @@ TOKEN_FILE="secrets/dev.token"
|
||||
|
||||
# Release versions
|
||||
# Version
|
||||
VERSION="3.1.7"
|
||||
VERSION="3.1.8"
|
||||
|
||||
# Registry/S3 settings
|
||||
REGISTRY_HOST="registry.kube5s.ru"
|
||||
|
||||
@@ -4,7 +4,7 @@ TOKEN_FILE="secrets/prod.token"
|
||||
|
||||
# Release versions
|
||||
# Version
|
||||
VERSION="2.1.6"
|
||||
VERSION="2.1.7"
|
||||
|
||||
# Registry/S3 settings
|
||||
REGISTRY_HOST="registry.kube5s.ru"
|
||||
|
||||
@@ -3,7 +3,7 @@ NUBES_API_ENDPOINT="https://lk-api-gateway-test.ngcloud.ru/api/v1/svc"
|
||||
TOKEN_FILE="secrets/test.token"
|
||||
|
||||
# Version
|
||||
VERSION="5.1.9"
|
||||
VERSION="5.1.10"
|
||||
|
||||
# Docs generation — ONLY from docs_gen/<stand>/ (never from docs/)
|
||||
DOCS_GEN_DIR="provider/docs_gen/test"
|
||||
|
||||
@@ -1187,7 +1187,8 @@ func (c *UniversalClient) resolveRefSvcParamValues(ctx context.Context, opParams
|
||||
}
|
||||
}
|
||||
if len(refById) == 0 {
|
||||
return params, nil
|
||||
// Даже без refSvcId — резолвим s3Uid внутри map-fixed (соглашение об именах).
|
||||
return c.resolveS3UidInAllMapFixed(params, opParams), nil
|
||||
}
|
||||
|
||||
resolved := make(map[int]string, len(params))
|
||||
@@ -1218,6 +1219,21 @@ func (c *UniversalClient) resolveRefSvcParamValues(ctx context.Context, opParams
|
||||
return resolved, nil
|
||||
}
|
||||
|
||||
// resolveS3UidInAllMapFixed проходит по всем параметрам и для map-fixed
|
||||
// резолвит s3Uid-подобные значения в UUID. Используется когда нет ни одного
|
||||
// параметра с refSvcId (ранний выход resolveRefSvcParamValues).
|
||||
func (c *UniversalClient) resolveS3UidInAllMapFixed(params map[int]string, opParams []universalCfsParam) map[int]string {
|
||||
result := make(map[int]string, len(params))
|
||||
for paramId, value := range params {
|
||||
if strings.TrimSpace(value) != "" && value != "{}" && strings.HasPrefix(strings.TrimSpace(value), "{") {
|
||||
result[paramId] = c.resolveS3UidInMapFixed(paramId, value, opParams)
|
||||
} else {
|
||||
result[paramId] = value
|
||||
}
|
||||
}
|
||||
return result
|
||||
}
|
||||
|
||||
// resolveS3UidInMapFixed парсит JSON map-fixed-параметра, находит ключи
|
||||
// по паттерну s3.*uid (case-insensitive) и резолвит значения-не-UUID
|
||||
// в UUID через S3 (сервис 12). Соглашение об именах: s3Uid, s3_uid, S3Uid → S3.
|
||||
|
||||
Reference in New Issue
Block a user