Skip to content

Commit a99352a

Browse files
kri5morgante
authored andcommitted
Fix: change pod_security_policy_config type to list(object()) (terraform-google-modules#408)
* Specify type for pod_security_policy_config This fixes an issue where type defaults to string, and leads to a type error attempting to set the value from outside the module. * Generate modules following the changes to pod_security_policy_config
1 parent d2a5e28 commit a99352a

File tree

12 files changed

+12
-5
lines changed

12 files changed

+12
-5
lines changed

autogen/main/variables.tf.tmpl

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -406,6 +406,7 @@ variable "enable_binary_authorization" {
406406
}
407407

408408
variable "pod_security_policy_config" {
409+
type = list(object({ enabled = bool }))
409410
description = "enabled - Enable the PodSecurityPolicy controller for this cluster. If enabled, pods must be valid under a PodSecurityPolicy to be created."
410411

411412
default = [{

autogen/safer-cluster/variables.tf.tmpl

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -311,6 +311,7 @@ variable "skip_provisioners" {
311311
}
312312

313313
variable "pod_security_policy_config" {
314+
type = list(object({ enabled = bool }))
314315
description = "enabled - Enable the PodSecurityPolicy controller for this cluster. If enabled, pods must be valid under a PodSecurityPolicy to be created."
315316

316317
default = [{

modules/beta-private-cluster-update-variant/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -208,7 +208,7 @@ Then perform the following commands on the root folder:
208208
| node\_pools\_taints | Map of lists containing node taints by node-pool name | object | `<map>` | no |
209209
| node\_version | The Kubernetes version of the node pools. Defaults kubernetes_version (master) variable and can be overridden for individual node pools by setting the `version` key on them. Must be empyty or set the same as master at cluster creation. | string | `""` | no |
210210
| non\_masquerade\_cidrs | List of strings in CIDR notation that specify the IP address ranges that do not use IP masquerading. | list(string) | `<list>` | no |
211-
| pod\_security\_policy\_config | enabled - Enable the PodSecurityPolicy controller for this cluster. If enabled, pods must be valid under a PodSecurityPolicy to be created. | list | `<list>` | no |
211+
| pod\_security\_policy\_config | enabled - Enable the PodSecurityPolicy controller for this cluster. If enabled, pods must be valid under a PodSecurityPolicy to be created. | object | `<list>` | no |
212212
| project\_id | The project ID to host the cluster in (required) | string | n/a | yes |
213213
| region | The region to host the cluster in (optional if zonal cluster / required if regional) | string | `"null"` | no |
214214
| regional | Whether is a regional cluster (zonal cluster if set false. WARNING: changing this after cluster creation is destructive!) | bool | `"true"` | no |

modules/beta-private-cluster-update-variant/variables.tf

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -399,6 +399,7 @@ variable "enable_binary_authorization" {
399399
}
400400

401401
variable "pod_security_policy_config" {
402+
type = list(object({ enabled = bool }))
402403
description = "enabled - Enable the PodSecurityPolicy controller for this cluster. If enabled, pods must be valid under a PodSecurityPolicy to be created."
403404

404405
default = [{

modules/beta-private-cluster/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -186,7 +186,7 @@ Then perform the following commands on the root folder:
186186
| node\_pools\_taints | Map of lists containing node taints by node-pool name | object | `<map>` | no |
187187
| node\_version | The Kubernetes version of the node pools. Defaults kubernetes_version (master) variable and can be overridden for individual node pools by setting the `version` key on them. Must be empyty or set the same as master at cluster creation. | string | `""` | no |
188188
| non\_masquerade\_cidrs | List of strings in CIDR notation that specify the IP address ranges that do not use IP masquerading. | list(string) | `<list>` | no |
189-
| pod\_security\_policy\_config | enabled - Enable the PodSecurityPolicy controller for this cluster. If enabled, pods must be valid under a PodSecurityPolicy to be created. | list | `<list>` | no |
189+
| pod\_security\_policy\_config | enabled - Enable the PodSecurityPolicy controller for this cluster. If enabled, pods must be valid under a PodSecurityPolicy to be created. | object | `<list>` | no |
190190
| project\_id | The project ID to host the cluster in (required) | string | n/a | yes |
191191
| region | The region to host the cluster in (optional if zonal cluster / required if regional) | string | `"null"` | no |
192192
| regional | Whether is a regional cluster (zonal cluster if set false. WARNING: changing this after cluster creation is destructive!) | bool | `"true"` | no |

modules/beta-private-cluster/variables.tf

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -399,6 +399,7 @@ variable "enable_binary_authorization" {
399399
}
400400

401401
variable "pod_security_policy_config" {
402+
type = list(object({ enabled = bool }))
402403
description = "enabled - Enable the PodSecurityPolicy controller for this cluster. If enabled, pods must be valid under a PodSecurityPolicy to be created."
403404

404405
default = [{

modules/beta-public-cluster/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -164,7 +164,7 @@ Then perform the following commands on the root folder:
164164
| node\_pools\_taints | Map of lists containing node taints by node-pool name | object | `<map>` | no |
165165
| node\_version | The Kubernetes version of the node pools. Defaults kubernetes_version (master) variable and can be overridden for individual node pools by setting the `version` key on them. Must be empyty or set the same as master at cluster creation. | string | `""` | no |
166166
| non\_masquerade\_cidrs | List of strings in CIDR notation that specify the IP address ranges that do not use IP masquerading. | list(string) | `<list>` | no |
167-
| pod\_security\_policy\_config | enabled - Enable the PodSecurityPolicy controller for this cluster. If enabled, pods must be valid under a PodSecurityPolicy to be created. | list | `<list>` | no |
167+
| pod\_security\_policy\_config | enabled - Enable the PodSecurityPolicy controller for this cluster. If enabled, pods must be valid under a PodSecurityPolicy to be created. | object | `<list>` | no |
168168
| project\_id | The project ID to host the cluster in (required) | string | n/a | yes |
169169
| region | The region to host the cluster in (optional if zonal cluster / required if regional) | string | `"null"` | no |
170170
| regional | Whether is a regional cluster (zonal cluster if set false. WARNING: changing this after cluster creation is destructive!) | bool | `"true"` | no |

modules/beta-public-cluster/variables.tf

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -375,6 +375,7 @@ variable "enable_binary_authorization" {
375375
}
376376

377377
variable "pod_security_policy_config" {
378+
type = list(object({ enabled = bool }))
378379
description = "enabled - Enable the PodSecurityPolicy controller for this cluster. If enabled, pods must be valid under a PodSecurityPolicy to be created."
379380

380381
default = [{

modules/safer-cluster-update-variant/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -234,7 +234,7 @@ For simplicity, we suggest using `roles/container.admin` and
234234
| node\_pools\_tags | Map of lists containing node network tags by node-pool name | map(list(string)) | `<map>` | no |
235235
| node\_pools\_taints | Map of lists containing node taints by node-pool name | object | `<map>` | no |
236236
| node\_version | The Kubernetes version of the node pools. Defaults kubernetes_version (master) variable and can be overridden for individual node pools by setting the `version` key on them. Must be empyty or set the same as master at cluster creation. | string | `""` | no |
237-
| pod\_security\_policy\_config | enabled - Enable the PodSecurityPolicy controller for this cluster. If enabled, pods must be valid under a PodSecurityPolicy to be created. | list | `<list>` | no |
237+
| pod\_security\_policy\_config | enabled - Enable the PodSecurityPolicy controller for this cluster. If enabled, pods must be valid under a PodSecurityPolicy to be created. | object | `<list>` | no |
238238
| project\_id | The project ID to host the cluster in | string | n/a | yes |
239239
| region | The region to host the cluster in | string | n/a | yes |
240240
| regional | Whether is a regional cluster (zonal cluster if set false. WARNING: changing this after cluster creation is destructive!) | bool | `"true"` | no |

modules/safer-cluster-update-variant/variables.tf

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -311,6 +311,7 @@ variable "skip_provisioners" {
311311
}
312312

313313
variable "pod_security_policy_config" {
314+
type = list(object({ enabled = bool }))
314315
description = "enabled - Enable the PodSecurityPolicy controller for this cluster. If enabled, pods must be valid under a PodSecurityPolicy to be created."
315316

316317
default = [{

modules/safer-cluster/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -234,7 +234,7 @@ For simplicity, we suggest using `roles/container.admin` and
234234
| node\_pools\_tags | Map of lists containing node network tags by node-pool name | map(list(string)) | `<map>` | no |
235235
| node\_pools\_taints | Map of lists containing node taints by node-pool name | object | `<map>` | no |
236236
| node\_version | The Kubernetes version of the node pools. Defaults kubernetes_version (master) variable and can be overridden for individual node pools by setting the `version` key on them. Must be empyty or set the same as master at cluster creation. | string | `""` | no |
237-
| pod\_security\_policy\_config | enabled - Enable the PodSecurityPolicy controller for this cluster. If enabled, pods must be valid under a PodSecurityPolicy to be created. | list | `<list>` | no |
237+
| pod\_security\_policy\_config | enabled - Enable the PodSecurityPolicy controller for this cluster. If enabled, pods must be valid under a PodSecurityPolicy to be created. | object | `<list>` | no |
238238
| project\_id | The project ID to host the cluster in | string | n/a | yes |
239239
| region | The region to host the cluster in | string | n/a | yes |
240240
| regional | Whether is a regional cluster (zonal cluster if set false. WARNING: changing this after cluster creation is destructive!) | bool | `"true"` | no |

modules/safer-cluster/variables.tf

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -311,6 +311,7 @@ variable "skip_provisioners" {
311311
}
312312

313313
variable "pod_security_policy_config" {
314+
type = list(object({ enabled = bool }))
314315
description = "enabled - Enable the PodSecurityPolicy controller for this cluster. If enabled, pods must be valid under a PodSecurityPolicy to be created."
315316

316317
default = [{

0 commit comments

Comments
 (0)