Skip to content

Commit 456b48a

Browse files
committed
api: add custom validation for v1.Duration types
Signed-off-by: Stefan Prodan <[email protected]>
1 parent d0b0c69 commit 456b48a

File tree

2 files changed

+3
-0
lines changed

2 files changed

+3
-0
lines changed

api/v1beta1/imageupdateautomation_types.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,8 @@ type ImageUpdateAutomationSpec struct {
4444

4545
// Interval gives an lower bound for how often the automation
4646
// run should be attempted.
47+
// +kubebuilder:validation:Type=string
48+
// +kubebuilder:validation:Pattern="^([0-9]+(\\.[0-9]+)?(ms|s|m|h))+$"
4749
// +required
4850
Interval metav1.Duration `json:"interval"`
4951

config/crd/bases/image.toolkit.fluxcd.io_imageupdateautomations.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -648,6 +648,7 @@ spec:
648648
interval:
649649
description: Interval gives an lower bound for how often the automation
650650
run should be attempted.
651+
pattern: ^([0-9]+(\.[0-9]+)?(ms|s|m|h))+$
651652
type: string
652653
sourceRef:
653654
description: SourceRef refers to the resource giving access details

0 commit comments

Comments
 (0)