From 3f0256b1681ae49970337f95ed1c7d39e1e6756c Mon Sep 17 00:00:00 2001 From: Miciah Masters Date: Mon, 11 Jul 2022 14:21:18 -0400 Subject: [PATCH] operator/ingress: Fix healthCheckInterval pattern Reject values for healthCheckInterval such as "0abc". This commit fixes bug 2106086. https://bugzilla.redhat.com/show_bug.cgi?id=2106086 * operator/v1/types_ingress.go (IngressControllerTuningOptions): Fix validation for healthCheckInterval. * operator/v1/0000_50_ingress-operator_00-ingresscontroller.crd.yaml: Regenerate. --- .../v1/0000_50_ingress-operator_00-ingresscontroller.crd.yaml | 2 +- operator/v1/types_ingress.go | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/operator/v1/0000_50_ingress-operator_00-ingresscontroller.crd.yaml b/operator/v1/0000_50_ingress-operator_00-ingresscontroller.crd.yaml index cb7d5c27f3d..d7597048056 100644 --- a/operator/v1/0000_50_ingress-operator_00-ingresscontroller.crd.yaml +++ b/operator/v1/0000_50_ingress-operator_00-ingresscontroller.crd.yaml @@ -1253,7 +1253,7 @@ spec: value is 5s. \n Currently the minimum allowed value is 1s and the maximum allowed value is 2147483647ms (24.85 days). Both are subject to change over time." - pattern: ^0|([0-9]+(\.[0-9]+)?(ns|us|µs|μs|ms|s|m|h))+$ + pattern: ^(0|([0-9]+(\.[0-9]+)?(ns|us|µs|μs|ms|s|m|h))+)$ type: string maxConnections: description: "maxConnections defines the maximum number of simultaneous diff --git a/operator/v1/types_ingress.go b/operator/v1/types_ingress.go index 7111521be95..7f7dfa3c317 100644 --- a/operator/v1/types_ingress.go +++ b/operator/v1/types_ingress.go @@ -1432,7 +1432,7 @@ type IngressControllerTuningOptions struct { // 2147483647ms (24.85 days). Both are subject to change over time. // // +kubebuilder:validation:Optional - // +kubebuilder:validation:Pattern=^0|([0-9]+(\.[0-9]+)?(ns|us|µs|μs|ms|s|m|h))+$ + // +kubebuilder:validation:Pattern=^(0|([0-9]+(\.[0-9]+)?(ns|us|µs|μs|ms|s|m|h))+)$ // +kubebuilder:validation:Type:=string // +optional HealthCheckInterval *metav1.Duration `json:"healthCheckInterval,omitempty"`