1.6 KiB
1.6 KiB
Задача: FindInstanceByDisplayName не находит существующий инстанс — анализ
Контекст
Провайдер terraform-provider-nubes v5.0.65, test-стенд.
Инстанс: NaeelOrg, serviceId=19, instanceUid=3f0850f2-3506-4efd-b84b-7270b5027ab5, статус Running.
Симптом
terraform plan с adopt_existing_on_create=true, resource_name="NaeelOrg" → + create. Apply → «уже существует».
Доказано curl-тестами
- Search API:
GET /instances?search=NaeelOrg&serviceId=19&isAuxiliary=false&isDeleted=false+UA: Mozilla/5.0→ находит. - GetInstanceStateRaw:
GET /instances/3f0850f2-...→ возвращает, isDeleted=false, Running.
Ключевые файлы
provider/internal/core/client.go—FindInstanceByDisplayName():568,doRequest():949,GetInstanceStateRaw():753,isInstanceDeleted():741provider/internal/resources_core/resource_diagnostics.go—PlanExistingResourceDiagnostics():14provider/internal/resources_core/crud.go—CreateResource():21,adoptExistingInstanceOnCreate():142generated/test/go/19_vc_org_resource.go—ModifyPlan()TEST_STAND/kuber/resources.tf— манифестHISTORY/OPUS/3006_0_answers.md:220 — search ✅ / fallback ❌
Задание
Найти точно, почему FindInstanceByDisplayName("NaeelOrg", 19) возвращает nil. Если не хватает данных — сказать, какой curl-тест запустить.