Skip to content

Commit

Permalink
Add force_destroy flag to CodeRepositoryIndex
Browse files Browse the repository at this point in the history
  • Loading branch information
JumiDeluxe committed Jan 9, 2025
1 parent 2860880 commit 78e3640
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 3 deletions.
6 changes: 6 additions & 0 deletions mmv1/products/gemini/CodeRepositoryIndex.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,12 @@ custom_code:
error_retry_predicates:
- 'transport_tpg.IsCodeRepositoryIndexUnreadyError'
- 'transport_tpg.IsRepositoryGroupQueueError'
virtual_fields:
- name: 'force_destroy'
description:
If set to true, any RepositoryGroups for this CodeRepositoryIndex will also be deleted.
type: Boolean
default_value: false
parameters:
- name: location
type: String
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
{{- if ne $.TargetVersionName "ga" -}}
obj = make(map[string]interface{})
obj["force"] = true
{{- end }}
if v, ok := d.GetOk("force_destroy"); ok {
if v == true {
obj = make(map[string]interface{})
obj["force"] = true
}
}
{{- end }}
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,7 @@ resource "google_gemini_code_repository_index" "example" {
labels = {"ccfe_debug_note": "terraform_e2e_should_be_deleted"}
location = "us-central1"
code_repository_index_id = "%{cri_id}"
force_destroy = true
}

resource "google_gemini_repository_group" "example" {
Expand All @@ -100,6 +101,9 @@ resource "google_gemini_repository_group" "example" {
branch_pattern = "main"
}
labels = {"label1": "value1"}
depends_on = [
google_gemini_code_repository_index.example
]
}

resource "google_developer_connect_git_repository_link" "conn" {
Expand Down Expand Up @@ -141,6 +145,9 @@ resource "google_gemini_repository_group" "example" {
branch_pattern = "main"
}
labels = {"label1": "value1"}
depends_on = [
google_gemini_code_repository_index.example
]
}

resource "google_developer_connect_git_repository_link" "conn" {
Expand Down

0 comments on commit 78e3640

Please sign in to comment.