From 9b9dfd2f7893998965b9e5a69868ae369d7271cf Mon Sep 17 00:00:00 2001 From: Julia Matuszewska Date: Wed, 18 Dec 2024 16:46:43 +0000 Subject: [PATCH] Force delete for CodeRepositoryIndex nested resource removal --- mmv1/products/gemini/CodeRepositoryIndex.yaml | 2 ++ .../pre_delete/code_repository_index_force_delete.go.tmpl | 4 ++++ 2 files changed, 6 insertions(+) create mode 100644 mmv1/templates/terraform/pre_delete/code_repository_index_force_delete.go.tmpl diff --git a/mmv1/products/gemini/CodeRepositoryIndex.yaml b/mmv1/products/gemini/CodeRepositoryIndex.yaml index 62cb5236c845..9a397e041745 100644 --- a/mmv1/products/gemini/CodeRepositoryIndex.yaml +++ b/mmv1/products/gemini/CodeRepositoryIndex.yaml @@ -51,6 +51,8 @@ async: result: resource_inside_response: true include_project: false +custom_code: + pre_delete: templates/terraform/pre_delete/code_repository_index_force_delete.go.tmpl error_retry_predicates: - 'transport_tpg.IsCodeRepositoryIndexUnreadyError' - 'transport_tpg.IsRepositoryGroupQueueError' diff --git a/mmv1/templates/terraform/pre_delete/code_repository_index_force_delete.go.tmpl b/mmv1/templates/terraform/pre_delete/code_repository_index_force_delete.go.tmpl new file mode 100644 index 000000000000..dcd492c9d0f6 --- /dev/null +++ b/mmv1/templates/terraform/pre_delete/code_repository_index_force_delete.go.tmpl @@ -0,0 +1,4 @@ +{{- if ne $.TargetVersionName "ga" -}} +obj = make(map[string]interface{}) +obj["force"] = true +{{- end }} \ No newline at end of file