Files
tf_provider/prompt_for_opus_bugs.md

1.6 KiB
Raw Permalink Blame History

Задача: 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.goFindInstanceByDisplayName():568, doRequest():949, GetInstanceStateRaw():753, isInstanceDeleted():741
  • provider/internal/resources_core/resource_diagnostics.goPlanExistingResourceDiagnostics():14
  • provider/internal/resources_core/crud.goCreateResource():21, adoptExistingInstanceOnCreate():142
  • generated/test/go/19_vc_org_resource.goModifyPlan()
  • TEST_STAND/kuber/resources.tf — манифест
  • HISTORY/OPUS/3006_0_answers.md:220 — search / fallback

Задание

Найти точно, почему FindInstanceByDisplayName("NaeelOrg", 19) возвращает nil. Если не хватает данных — сказать, какой curl-тест запустить.