Skip to content

Commit

Permalink
refactor: reformat cgroup mode validation for improved readability
Browse files Browse the repository at this point in the history
Updated the condition block in `node_pools_cgroup_mode` validation across multiple variables files to use a more readable multi-line format.
  • Loading branch information
Ameausoone committed Feb 13, 2025
1 parent 37d9d8e commit ed85cfe
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 3 deletions.
7 changes: 6 additions & 1 deletion autogen/main/variables.tf.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,12 @@ variable "node_pools_cgroup_mode" {
type = string
description = "Specifies the Linux cgroup mode for autopilot Kubernetes nodes in the cluster. Accepted values are `CGROUP_MODE_UNSPECIFIED`, `CGROUP_MODE_V1`, and `CGROUP_MODE_V2`, which determine the control group hierarchy used for resource management."
validation {
condition = var.node_pools_cgroup_mode == null || contains(["", "CGROUP_MODE_UNSPECIFIED", "CGROUP_MODE_V1", "CGROUP_MODE_V2"], var.node_pools_cgroup_mode != null ? var.node_pools_cgroup_mode : "")
condition = var.node_pools_cgroup_mode == null || contains([
"",
"CGROUP_MODE_UNSPECIFIED",
"CGROUP_MODE_V1",
"CGROUP_MODE_V2"
], var.node_pools_cgroup_mode != null ? var.node_pools_cgroup_mode : "")
error_message = "The node_pools_cgroup_mode must be one of CGROUP_MODE_UNSPECIFIED, CGROUP_MODE_V1, or CGROUP_MODE_V2."
}
default = null
Expand Down
7 changes: 6 additions & 1 deletion modules/beta-autopilot-private-cluster/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,12 @@ variable "node_pools_cgroup_mode" {
type = string
description = "Specifies the Linux cgroup mode for autopilot Kubernetes nodes in the cluster. Accepted values are `CGROUP_MODE_UNSPECIFIED`, `CGROUP_MODE_V1`, and `CGROUP_MODE_V2`, which determine the control group hierarchy used for resource management."
validation {
condition = var.node_pools_cgroup_mode == null || contains(["", "CGROUP_MODE_UNSPECIFIED", "CGROUP_MODE_V1", "CGROUP_MODE_V2"], var.node_pools_cgroup_mode != null ? var.node_pools_cgroup_mode : "")
condition = var.node_pools_cgroup_mode == null || contains([
"",
"CGROUP_MODE_UNSPECIFIED",
"CGROUP_MODE_V1",
"CGROUP_MODE_V2"
], var.node_pools_cgroup_mode != null ? var.node_pools_cgroup_mode : "")
error_message = "The node_pools_cgroup_mode must be one of CGROUP_MODE_UNSPECIFIED, CGROUP_MODE_V1, or CGROUP_MODE_V2."
}
default = null
Expand Down
7 changes: 6 additions & 1 deletion modules/beta-autopilot-public-cluster/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,12 @@ variable "node_pools_cgroup_mode" {
type = string
description = "Specifies the Linux cgroup mode for autopilot Kubernetes nodes in the cluster. Accepted values are `CGROUP_MODE_UNSPECIFIED`, `CGROUP_MODE_V1`, and `CGROUP_MODE_V2`, which determine the control group hierarchy used for resource management."
validation {
condition = var.node_pools_cgroup_mode == null || contains(["", "CGROUP_MODE_UNSPECIFIED", "CGROUP_MODE_V1", "CGROUP_MODE_V2"], var.node_pools_cgroup_mode != null ? var.node_pools_cgroup_mode : "")
condition = var.node_pools_cgroup_mode == null || contains([
"",
"CGROUP_MODE_UNSPECIFIED",
"CGROUP_MODE_V1",
"CGROUP_MODE_V2"
], var.node_pools_cgroup_mode != null ? var.node_pools_cgroup_mode : "")
error_message = "The node_pools_cgroup_mode must be one of CGROUP_MODE_UNSPECIFIED, CGROUP_MODE_V1, or CGROUP_MODE_V2."
}
default = null
Expand Down

0 comments on commit ed85cfe

Please sign in to comment.