Skip to content

Commit 9a7bc21

Browse files
fix: Verify google_cloud_run_v2_{service,job} 'timeout' field with regex (#10611) (#18260)
[upstream:be365d7a2466aebe55fafcb2fa317ff60eb87b45] Signed-off-by: Modular Magician <magic-modules@google.com>
1 parent c8c391d commit 9a7bc21

File tree

2 files changed

+8
-6
lines changed

2 files changed

+8
-6
lines changed

google/services/cloudrunv2/resource_cloud_run_v2_job.go

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -256,9 +256,10 @@ If omitted, a port number will be chosen and passed to the container through the
256256
Description: `Email address of the IAM service account associated with the Task of a Job. The service account represents the identity of the running task, and determines what permissions the task has. If not provided, the task will use the project's default service account.`,
257257
},
258258
"timeout": {
259-
Type: schema.TypeString,
260-
Computed: true,
261-
Optional: true,
259+
Type: schema.TypeString,
260+
Computed: true,
261+
Optional: true,
262+
ValidateFunc: verify.ValidateRegexp(`^[0-9]+(?:\.[0-9]{1,9})?s$`),
262263
Description: `Max allowed time duration the Task may be active before the system will actively try to mark it failed and kill associated containers. This applies per attempt of a task, meaning each retry can run for the full timeout.
263264
264265
A duration in seconds with up to nine fractional digits, ending with 's'. Example: "3.5s".`,

google/services/cloudrunv2/resource_cloud_run_v2_service.go

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -559,9 +559,10 @@ All system labels in v1 now have a corresponding field in v2 RevisionTemplate.`,
559559
Description: `Enables session affinity. For more information, go to https://cloud.google.com/run/docs/configuring/session-affinity`,
560560
},
561561
"timeout": {
562-
Type: schema.TypeString,
563-
Computed: true,
564-
Optional: true,
562+
Type: schema.TypeString,
563+
Computed: true,
564+
Optional: true,
565+
ValidateFunc: verify.ValidateRegexp(`^[0-9]+(?:\.[0-9]{1,9})?s$`),
565566
Description: `Max allowed time for an instance to respond to a request.
566567
567568
A duration in seconds with up to nine fractional digits, ending with 's'. Example: "3.5s".`,

0 commit comments

Comments
 (0)