Files
tf_provider/prompt_for_opus_bugs.md
T

29 lines
1.6 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
# Задача: 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-тестами
1. Search API: `GET /instances?search=NaeelOrg&serviceId=19&isAuxiliary=false&isDeleted=false` + `UA: Mozilla/5.0` → находит.
2. GetInstanceStateRaw: `GET /instances/3f0850f2-...` → возвращает, isDeleted=false, Running.
## Ключевые файлы
- `provider/internal/core/client.go``FindInstanceByDisplayName()`:568, `doRequest()`:949, `GetInstanceStateRaw()`:753, `isInstanceDeleted()`:741
- `provider/internal/resources_core/resource_diagnostics.go``PlanExistingResourceDiagnostics()`:14
- `provider/internal/resources_core/crud.go``CreateResource()`:21, `adoptExistingInstanceOnCreate()`:142
- `generated/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-тест запустить.