api: add custom validation for v1.Duration types
Signed-off-by: Stefan Prodan <stefan.prodan@gmail.com>
This commit is contained in:
parent
d0b0c69269
commit
456b48a909
|
@ -44,6 +44,8 @@ type ImageUpdateAutomationSpec struct {
|
|||
|
||||
// Interval gives an lower bound for how often the automation
|
||||
// run should be attempted.
|
||||
// +kubebuilder:validation:Type=string
|
||||
// +kubebuilder:validation:Pattern="^([0-9]+(\\.[0-9]+)?(ms|s|m|h))+$"
|
||||
// +required
|
||||
Interval metav1.Duration `json:"interval"`
|
||||
|
||||
|
|
|
@ -648,6 +648,7 @@ spec:
|
|||
interval:
|
||||
description: Interval gives an lower bound for how often the automation
|
||||
run should be attempted.
|
||||
pattern: ^([0-9]+(\.[0-9]+)?(ms|s|m|h))+$
|
||||
type: string
|
||||
sourceRef:
|
||||
description: SourceRef refers to the resource giving access details
|
||||
|
|
Loading…
Reference in New Issue