Skip to content

Commit bdc6a94

Browse files
author
Kate Osborn
committed
Update duration and size regexes
1 parent 4b8ab65 commit bdc6a94

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

apis/v1alpha1/clientsettingspolicy_types.go

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -126,16 +126,15 @@ type ClientKeepAliveTimeout struct {
126126
}
127127

128128
// Duration is a string value representing a duration in time.
129-
// Duration can be specified in milliseconds (ms), seconds (s), minutes (m), hours (h),
130-
// or days (d). A value without a suffix is seconds.
131-
// Examples: 300d, 20h, 12m, 45s, 150ms.
129+
// Duration can be specified in milliseconds (ms) or seconds (s) A value without a suffix is seconds.
130+
// Examples: 120s, 50ms.
132131
//
133-
// +kubebuilder:validation:Pattern=`^\d+(ms|s|m|h|d)?$`
132+
// +kubebuilder:validation:Pattern=`^\d{1,4}(ms|s)?$`
134133
type Duration string
135134

136135
// Size is a string value representing a size. Size can be specified in bytes, kilobytes (k), megabytes (m),
137136
// or gigabytes (g).
138137
// Examples: 1024, 8k, 1m.
139138
//
140-
// +kubebuilder:validation:Pattern=`^\d+(k|m|g)?$`
139+
// +kubebuilder:validation:Pattern=`^\d{1,4}(k|m|g)?$`
141140
type Size string

0 commit comments

Comments
 (0)