Skip to content

Commit

Permalink
feat: Add timeouts variable for safer cluster module (#1613)
Browse files Browse the repository at this point in the history
Co-authored-by: Bharath KKB <[email protected]>
  • Loading branch information
christiangonre and bharathkkb authored May 11, 2023
1 parent e957469 commit 146b2e7
Show file tree
Hide file tree
Showing 8 changed files with 38 additions and 0 deletions.
2 changes: 2 additions & 0 deletions autogen/safer-cluster/main.tf.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -193,4 +193,6 @@ module "gke" {
filestore_csi_driver = var.filestore_csi_driver

notification_config_topic = var.notification_config_topic

timeouts = var.timeouts
}
10 changes: 10 additions & 0 deletions autogen/safer-cluster/variables.tf.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -474,3 +474,13 @@ variable "notification_config_topic" {
description = "The desired Pub/Sub topic to which notifications will be sent by GKE. Format is projects/{project}/topics/{topic}."
default = ""
}

variable "timeouts" {
type = map(string)
description = "Timeout for cluster operations."
default = {}
validation {
condition = !contains([for t in keys(var.timeouts) : contains(["create", "update", "delete"], t)], false)
error_message = "Only create, update, delete timeouts can be specified."
}
}
1 change: 1 addition & 0 deletions modules/safer-cluster-update-variant/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -267,6 +267,7 @@ For simplicity, we suggest using `roles/container.admin` and
| sandbox\_enabled | (Beta) Enable GKE Sandbox (Do not forget to set `image_type` = `COS_CONTAINERD` to use it). | `bool` | `false` | no |
| stub\_domains | Map of stub domains and their resolvers to forward DNS queries for a certain domain to an external DNS server | `map(list(string))` | `{}` | no |
| subnetwork | The subnetwork to host the cluster in | `string` | n/a | yes |
| timeouts | Timeout for cluster operations. | `map(string)` | `{}` | no |
| upstream\_nameservers | If specified, the values replace the nameservers taken by default from the node’s /etc/resolv.conf | `list(string)` | `[]` | no |
| windows\_node\_pools | List of maps containing node pools | `list(map(string))` | `[]` | no |
| zones | The zones to host the cluster in | `list(string)` | `[]` | no |
Expand Down
2 changes: 2 additions & 0 deletions modules/safer-cluster-update-variant/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -189,4 +189,6 @@ module "gke" {
filestore_csi_driver = var.filestore_csi_driver

notification_config_topic = var.notification_config_topic

timeouts = var.timeouts
}
10 changes: 10 additions & 0 deletions modules/safer-cluster-update-variant/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -474,3 +474,13 @@ variable "notification_config_topic" {
description = "The desired Pub/Sub topic to which notifications will be sent by GKE. Format is projects/{project}/topics/{topic}."
default = ""
}

variable "timeouts" {
type = map(string)
description = "Timeout for cluster operations."
default = {}
validation {
condition = !contains([for t in keys(var.timeouts) : contains(["create", "update", "delete"], t)], false)
error_message = "Only create, update, delete timeouts can be specified."
}
}
1 change: 1 addition & 0 deletions modules/safer-cluster/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -267,6 +267,7 @@ For simplicity, we suggest using `roles/container.admin` and
| sandbox\_enabled | (Beta) Enable GKE Sandbox (Do not forget to set `image_type` = `COS_CONTAINERD` to use it). | `bool` | `false` | no |
| stub\_domains | Map of stub domains and their resolvers to forward DNS queries for a certain domain to an external DNS server | `map(list(string))` | `{}` | no |
| subnetwork | The subnetwork to host the cluster in | `string` | n/a | yes |
| timeouts | Timeout for cluster operations. | `map(string)` | `{}` | no |
| upstream\_nameservers | If specified, the values replace the nameservers taken by default from the node’s /etc/resolv.conf | `list(string)` | `[]` | no |
| windows\_node\_pools | List of maps containing node pools | `list(map(string))` | `[]` | no |
| zones | The zones to host the cluster in | `list(string)` | `[]` | no |
Expand Down
2 changes: 2 additions & 0 deletions modules/safer-cluster/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -189,4 +189,6 @@ module "gke" {
filestore_csi_driver = var.filestore_csi_driver

notification_config_topic = var.notification_config_topic

timeouts = var.timeouts
}
10 changes: 10 additions & 0 deletions modules/safer-cluster/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -474,3 +474,13 @@ variable "notification_config_topic" {
description = "The desired Pub/Sub topic to which notifications will be sent by GKE. Format is projects/{project}/topics/{topic}."
default = ""
}

variable "timeouts" {
type = map(string)
description = "Timeout for cluster operations."
default = {}
validation {
condition = !contains([for t in keys(var.timeouts) : contains(["create", "update", "delete"], t)], false)
error_message = "Only create, update, delete timeouts can be specified."
}
}

0 comments on commit 146b2e7

Please sign in to comment.