Skip to content

Commit 90a9c1c

Browse files
authored
chore/allow hyphens in partition_name and slurm_cluster_name, increase max length to 20 for slurm_cluster_name (GoogleCloudPlatform#4316)
1 parent 8120a78 commit 90a9c1c

5 files changed

Lines changed: 10 additions & 10 deletions

File tree

community/modules/compute/gke-nodeset/variables.tf

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,8 @@ variable "slurm_cluster_name" {
2727
description = "Cluster name, used in slurm controller"
2828

2929
validation {
30-
condition = var.slurm_cluster_name != null && can(regex("^[a-z](?:[a-z0-9]{0,9})$", var.slurm_cluster_name))
31-
error_message = "Variable 'slurm_cluster_name' must be a match of regex '^[a-z](?:[a-z0-9]{0,9})$'."
30+
condition = var.slurm_cluster_name != null && can(regex("^[a-z]([-a-z0-9]{0,20})$", var.slurm_cluster_name))
31+
error_message = "Variable 'slurm_cluster_name' must be a match of regex '^[a-z]([-a-z0-9]{0,20})$'."
3232
}
3333
}
3434

community/modules/compute/schedmd-slurm-gcp-v6-partition/variables.tf

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,8 @@ variable "partition_name" {
1717
type = string
1818

1919
validation {
20-
condition = can(regex("^[a-z](?:[a-z0-9]*)$", var.partition_name))
21-
error_message = "Variable 'partition_name' must be a match of regex '^[a-z](?:[a-z0-9]*)$'."
20+
condition = can(regex("^[a-z](?:[a-z0-9-]*)$", var.partition_name))
21+
error_message = "Variable 'partition_name' must be a match of regex '^[a-z](?:[a-z0-9-]*)$'."
2222
}
2323
}
2424

community/modules/internal/slurm-gcp/instance_template/variables.tf

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -383,8 +383,8 @@ variable "slurm_cluster_name" {
383383
description = "Cluster name, used for resource naming."
384384

385385
validation {
386-
condition = can(regex("^[a-z](?:[a-z0-9]{0,9})$", var.slurm_cluster_name))
387-
error_message = "Variable 'slurm_cluster_name' must be a match of regex '^[a-z](?:[a-z0-9]{0,9})$'."
386+
condition = can(regex("^[a-z]([-a-z0-9]{0,20})$", var.slurm_cluster_name))
387+
error_message = "Variable 'slurm_cluster_name' must be a match of regex '^[a-z]([-a-z0-9]{0,20})$'."
388388
}
389389
}
390390

community/modules/scheduler/schedmd-slurm-gcp-v6-controller/modules/slurm_files/variables.tf

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -62,8 +62,8 @@ variable "slurm_cluster_name" {
6262
description = "The cluster name, used for resource naming and slurm accounting."
6363

6464
validation {
65-
condition = can(regex("^[a-z](?:[a-z0-9]{0,9})$", var.slurm_cluster_name))
66-
error_message = "Variable 'slurm_cluster_name' must be a match of regex '^[a-z](?:[a-z0-9]{0,9})$'."
65+
condition = can(regex("^[a-z]([-a-z0-9]{0,20})$", var.slurm_cluster_name))
66+
error_message = "Variable 'slurm_cluster_name' must be a match of regex '^[a-z]([-a-z0-9]{0,20})$'."
6767
}
6868
}
6969

community/modules/scheduler/schedmd-slurm-gcp-v6-controller/variables.tf

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,8 +37,8 @@ variable "slurm_cluster_name" {
3737
default = null
3838

3939
validation {
40-
condition = var.slurm_cluster_name == null || can(regex("^[a-z](?:[a-z0-9]{0,9})$", var.slurm_cluster_name))
41-
error_message = "Variable 'slurm_cluster_name' must be a match of regex '^[a-z](?:[a-z0-9]{0,9})$'."
40+
condition = var.slurm_cluster_name == null || can(regex("^[a-z]([-a-z0-9]{0,20})$", var.slurm_cluster_name))
41+
error_message = "Variable 'slurm_cluster_name' must be a match of regex '^[a-z]([-a-z0-9]{0,20})$'."
4242
}
4343
}
4444

0 commit comments

Comments
 (0)