Skip to content

Commit 311da73

Browse files
authored
[ws-manager-mk2] Add duration validation (#16687)
1 parent 5fd8212 commit 311da73

File tree

2 files changed

+3
-0
lines changed

2 files changed

+3
-0
lines changed

components/ws-manager-api/go/crd/v1/workspace_types.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,8 @@ type GitSpec struct {
8888
}
8989

9090
type TimeoutSpec struct {
91+
// +kubebuilder:validation:Type=string
92+
// +kubebuilder:validation:Pattern="^([0-9]+(\\.[0-9]+)?(ms|s|m|h))+$"
9193
Time *metav1.Duration `json:"time,omitempty"`
9294
}
9395

components/ws-manager-mk2/config/crd/bases/workspace.gitpod.io_workspaces.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -262,6 +262,7 @@ spec:
262262
timeout:
263263
properties:
264264
time:
265+
pattern: ^([0-9]+(\.[0-9]+)?(ms|s|m|h))+$
265266
type: string
266267
type: object
267268
type:

0 commit comments

Comments
 (0)