Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions build/int.cloudbuild.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,18 @@ steps:
echo -n "Folders in scope for tests:"
find . -type d -printf '%P\n'
- id: resource specific fixups
name: golang:1.23
entrypoint: bash
args:
- -c
- |
set -e
go install github.com/minamijoyo/[email protected]
# Add `deletion_protection = false` to google_container_cluster.default resources
find ./gke -name "*.tf" -print | xargs -t -I {} $$GOPATH/bin/hcledit attribute append resource.google_container_cluster.default.deletion_protection 'false' -u -f {} || true
- id: prepare
name: 'gcr.io/cloud-foundation-cicd/$_DOCKER_IMAGE_DEVELOPER_TOOLS:$_DOCKER_TAG_VERSION_DEVELOPER_TOOLS'
args: ['/bin/bash', '-c', 'source /usr/local/bin/task_helper_functions.sh && prepare_environment']
Expand Down
4 changes: 0 additions & 4 deletions gke/autopilot/basic/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,5 @@ resource "google_container_cluster" "default" {
location = "us-central1"

enable_autopilot = true

# Set `deletion_protection` to `true` will ensure that one cannot
# accidentally delete this instance by use of Terraform.
deletion_protection = false
}
# [END gke_autopilot_basic]
4 changes: 0 additions & 4 deletions gke/autopilot/config_sync/git/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,6 @@ resource "google_container_cluster" "default" {
}

enable_autopilot = true

# Set `deletion_protection` to `true` will ensure that one cannot
# accidentally delete this instance by use of Terraform.
deletion_protection = false
}

resource "google_gke_hub_feature" "configmanagement_feature" {
Expand Down
4 changes: 0 additions & 4 deletions gke/autopilot/config_sync/oci/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,6 @@ resource "google_container_cluster" "default" {
}

enable_autopilot = true

# Set `deletion_protection` to `true` will ensure that one cannot
# accidentally delete this instance by use of Terraform.
deletion_protection = false
}

resource "google_gke_hub_feature" "configmanagement_feature" {
Expand Down
4 changes: 0 additions & 4 deletions gke/autopilot/iap/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,6 @@ resource "google_container_cluster" "default" {
location = "us-central1"

enable_autopilot = true

# Set `deletion_protection` to `true` will ensure that one cannot
# accidentally delete this instance by use of Terraform.
deletion_protection = false
}

# Required for internal ingress
Expand Down
4 changes: 0 additions & 4 deletions gke/autopilot/labels/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,5 @@ resource "google_container_cluster" "default" {
resource_labels = {
foo = "bar"
}

# Set `deletion_protection` to `true` will ensure that one cannot
# accidentally delete this instance by use of Terraform.
deletion_protection = false
}
# [END gke_autopilot_labels]
4 changes: 0 additions & 4 deletions gke/autopilot/mesh/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -35,10 +35,6 @@ resource "google_container_cluster" "default" {
fleet {
project = data.google_project.default.project_id
}

# Set `deletion_protection` to `true` will ensure that one cannot
# accidentally delete this instance by use of Terraform.
deletion_protection = false
}

resource "google_gke_hub_feature" "default" {
Expand Down
4 changes: 0 additions & 4 deletions gke/autopilot/policycontroller/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -36,10 +36,6 @@ resource "google_container_cluster" "default" {
fleet {
project = data.google_project.default.project_id
}

# Set `deletion_protection` to `true` will ensure that one cannot
# accidentally delete this instance by use of Terraform.
deletion_protection = false
}

resource "google_gke_hub_feature" "default" {
Expand Down
4 changes: 0 additions & 4 deletions gke/autopilot/release_channel/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,5 @@ resource "google_container_cluster" "default" {
release_channel {
channel = "REGULAR"
}

# Set `deletion_protection` to `true` will ensure that one cannot
# accidentally delete this instance by use of Terraform.
deletion_protection = false
}
# [END gke_autopilot_release_channel]
4 changes: 0 additions & 4 deletions gke/autopilot/reservation/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,6 @@ resource "google_container_cluster" "default" {
location = "us-central1"

enable_autopilot = true

# Set `deletion_protection` to `true` will ensure that one cannot
# accidentally delete this instance by use of Terraform.
deletion_protection = false
}

# [START gke_autopilot_reservation_specific_reservation]
Expand Down
4 changes: 0 additions & 4 deletions gke/autopilot/tag/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,6 @@ resource "google_container_cluster" "default" {
location = "us-central1"

enable_autopilot = true

# Set `deletion_protection` to `true` will ensure that one cannot
# accidentally delete this instance by use of Terraform.
deletion_protection = false
}

data "google_project" "default" {}
Expand Down
4 changes: 0 additions & 4 deletions gke/standard/regional/binary-authorization/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,5 @@ resource "google_container_cluster" "enforce" {
binary_authorization {
evaluation_mode = "PROJECT_SINGLETON_POLICY_ENFORCE"
}

# Set `deletion_protection` to `true` will ensure that one cannot
# accidentally delete this instance by use of Terraform.
deletion_protection = false
}
# [END gke_standard_regional_binauthz_enforce]
4 changes: 0 additions & 4 deletions gke/standard/regional/gemma-tgi/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -29,10 +29,6 @@ resource "google_container_cluster" "default" {
workload_identity_config {
workload_pool = "${data.google_project.default.project_id}.svc.id.goog"
}

# Set `deletion_protection` to `true` will ensure that one cannot
# accidentally delete this instance by use of Terraform.
deletion_protection = false
}

resource "google_container_node_pool" "default" {
Expand Down
4 changes: 0 additions & 4 deletions gke/standard/regional/hpa-logs/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,5 @@ resource "google_container_cluster" "default" {
logging_config {
enable_components = ["SYSTEM_COMPONENTS", "KCP_HPA"]
}

# Set `deletion_protection` to `true` will ensure that one cannot
# accidentally delete this instance by use of Terraform.
deletion_protection = false
}
# [END gke_standard_regional_hpa_logs]
4 changes: 0 additions & 4 deletions gke/standard/regional/labels/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,6 @@ resource "google_container_cluster" "default" {
resource_labels = {
foo = "bar"
}

# Set `deletion_protection` to `true` will ensure that one cannot
# accidentally delete this instance by use of Terraform.
deletion_protection = false
}
# [END gke_standard_regional_labels_cluster]
# [END gke_standard_regional_labels]
4 changes: 0 additions & 4 deletions gke/standard/regional/loadbalancer/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,6 @@ resource "google_container_cluster" "default" {
initial_node_count = 1

enable_l4_ilb_subsetting = true

# Set `deletion_protection` to `true` will ensure that one cannot
# accidentally delete this instance by use of Terraform.
deletion_protection = false
}
# [END gke_standard_regional_loadbalancer_cluster]

Expand Down
4 changes: 0 additions & 4 deletions gke/standard/regional/multi-zone/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,5 @@ resource "google_container_cluster" "default" {
location = "us-central1"
node_locations = ["us-central1-b", "us-central1-c"]
initial_node_count = 2

# Set `deletion_protection` to `true` will ensure that one cannot
# accidentally delete this instance by use of Terraform.
deletion_protection = false
}
# [END gke_standard_regional_multi_zone]
4 changes: 0 additions & 4 deletions gke/standard/regional/node_pool/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,6 @@ resource "google_container_cluster" "default" {

initial_node_count = 1
remove_default_node_pool = true

# Set `deletion_protection` to `true` will ensure that one cannot
# accidentally delete this instance by use of Terraform.
deletion_protection = false
}

# [START gke_standard_regional_node_pool]
Expand Down
4 changes: 0 additions & 4 deletions gke/standard/regional/node_system_config/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -42,10 +42,6 @@ resource "google_container_cluster" "default" {
}
}
}

# Set `deletion_protection` to `true` will ensure that one cannot
# accidentally delete this instance by use of Terraform.
deletion_protection = false
}
# [END gke_standard_regional_node_system_config]

Expand Down
4 changes: 0 additions & 4 deletions gke/standard/regional/single-zone/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,5 @@ resource "google_container_cluster" "default" {
location = "us-west1"
node_locations = ["us-west1-c"]
initial_node_count = 2

# Set `deletion_protection` to `true` will ensure that one cannot
# accidentally delete this instance by use of Terraform.
deletion_protection = false
}
# [END gke_standard_regional_single_zone]
4 changes: 0 additions & 4 deletions gke/standard/regional/windows/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,6 @@ resource "google_container_cluster" "default" {
location = "us-west1"

initial_node_count = 1

# Set `deletion_protection` to `true` will ensure that one cannot
# accidentally delete this instance by use of Terraform.
deletion_protection = false
}
# [END gke_standard_regional_windows_cluster]

Expand Down
4 changes: 0 additions & 4 deletions gke/standard/zonal/arm/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -31,10 +31,6 @@ resource "google_container_cluster" "default" {
machine_type = "t2a-standard-1"
service_account = google_service_account.default.email
}

# Set `deletion_protection` to `true` will ensure that one cannot
# accidentally delete this instance by use of Terraform.
deletion_protection = false
}
# [END gke_standard_zonal_arm_cluster]

Expand Down
4 changes: 0 additions & 4 deletions gke/standard/zonal/gpu/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,5 @@ resource "google_container_cluster" "default" {
}
machine_type = "n1-standard-2"
}

# Set `deletion_protection` to `true` will ensure that one cannot
# accidentally delete this instance by use of Terraform.
deletion_protection = false
}
# [END gke_standard_zonal_gpu]
4 changes: 0 additions & 4 deletions gke/standard/zonal/multi-zone/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,5 @@ resource "google_container_cluster" "default" {
location = "us-central1-a"
node_locations = ["us-central1-b", "us-central1-c"]
initial_node_count = 2

# Set `deletion_protection` to `true` will ensure that one cannot
# accidentally delete this instance by use of Terraform.
deletion_protection = false
}
# [END gke_standard_zonal_multi_zone]
4 changes: 0 additions & 4 deletions gke/standard/zonal/node_image/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,5 @@ resource "google_container_cluster" "default" {
node_config {
image_type = "cos_containerd"
}

# Set `deletion_protection` to `true` will ensure that one cannot
# accidentally delete this instance by use of Terraform.
deletion_protection = false
}
# [END gke_standard_zonal_node_image]
4 changes: 0 additions & 4 deletions gke/standard/zonal/reservation/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -47,10 +47,6 @@ resource "google_container_cluster" "default" {
depends_on = [
google_compute_reservation.any_reservation
]

# Set `deletion_protection` to `true` will ensure that one cannot
# accidentally delete this instance by use of Terraform.
deletion_protection = false
}
# [END gke_standard_zonal_reservation_any_cluster]

Expand Down
4 changes: 0 additions & 4 deletions gke/standard/zonal/secondary-boot-disk/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,6 @@ resource "google_container_cluster" "default" {
# secondary_boot_disks require GKE 1.28.3-gke.106700 or later, which should
# be true for all release channels apart from EXTENDED.
# If required, Use `release_channel = "EXTENDED"` and set `min_master_version`.

# Setting `deletion_protection` to `true` would prevent
# accidental deletion of this instance using Terraform.
deletion_protection = false
}
# [END gke_standard_zonal_secondary_boot_disk_cluster]

Expand Down
4 changes: 0 additions & 4 deletions gke/standard/zonal/single-zone/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,5 @@ resource "google_container_cluster" "default" {
name = "gke-standard-zonal-single-zone"
location = "us-central1-a"
initial_node_count = 1

# Set `deletion_protection` to `true` will ensure that one cannot
# accidentally delete this instance by use of Terraform.
deletion_protection = false
}
# [END gke_standard_zonal_single_zone]