You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: operator/v1/tests/ingresscontrollers.operator.openshift.io/AAA_ungated.yaml
+107Lines changed: 107 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -563,6 +563,113 @@ tests:
563
563
tuningOptions:
564
564
connectTimeout: "4 s"
565
565
expectedError: "IngressController.operator.openshift.io \"default\" is invalid: spec.tuningOptions.connectTimeout: Invalid value: \"4 s\": spec.tuningOptions.connectTimeout in body should match '^(0|([0-9]+(\\.[0-9]+)?(ns|us|µs|μs|ms|s|m|h))+)$'"
566
+
- name: Should be able to create an IngressController with valid nominal httpKeepAlive timeout
567
+
initial: |
568
+
apiVersion: operator.openshift.io/v1
569
+
kind: IngressController
570
+
metadata:
571
+
name: default
572
+
namespace: openshift-ingress-operator
573
+
spec:
574
+
tuningOptions:
575
+
httpKeepAliveTimeout: 10s
576
+
expected: |
577
+
apiVersion: operator.openshift.io/v1
578
+
kind: IngressController
579
+
metadata:
580
+
name: default
581
+
namespace: openshift-ingress-operator
582
+
spec:
583
+
httpEmptyRequestsPolicy: Respond
584
+
idleConnectionTerminationPolicy: Immediate
585
+
tuningOptions:
586
+
httpKeepAliveTimeout: 10s
587
+
- name: Should be able to create an IngressController with valid composite httpKeepAlive timeout
588
+
initial: |
589
+
apiVersion: operator.openshift.io/v1
590
+
kind: IngressController
591
+
metadata:
592
+
name: default
593
+
namespace: openshift-ingress-operator
594
+
spec:
595
+
tuningOptions:
596
+
httpKeepAliveTimeout: 100s300ms
597
+
expected: |
598
+
apiVersion: operator.openshift.io/v1
599
+
kind: IngressController
600
+
metadata:
601
+
name: default
602
+
namespace: openshift-ingress-operator
603
+
spec:
604
+
httpEmptyRequestsPolicy: Respond
605
+
idleConnectionTerminationPolicy: Immediate
606
+
tuningOptions:
607
+
httpKeepAliveTimeout: 100s300ms
608
+
- name: Should be able to create an IngressController with valid fraction httpKeepAlive timeout
609
+
initial: |
610
+
apiVersion: operator.openshift.io/v1
611
+
kind: IngressController
612
+
metadata:
613
+
name: default
614
+
namespace: openshift-ingress-operator
615
+
spec:
616
+
tuningOptions:
617
+
httpKeepAliveTimeout: 1.5m
618
+
expected: |
619
+
apiVersion: operator.openshift.io/v1
620
+
kind: IngressController
621
+
metadata:
622
+
name: default
623
+
namespace: openshift-ingress-operator
624
+
spec:
625
+
httpEmptyRequestsPolicy: Respond
626
+
idleConnectionTerminationPolicy: Immediate
627
+
tuningOptions:
628
+
httpKeepAliveTimeout: 1.5m
629
+
- name: Should not be able to create an IngressController with invalid unit httpKeepAlive timeout
630
+
initial: |
631
+
apiVersion: operator.openshift.io/v1
632
+
kind: IngressController
633
+
metadata:
634
+
name: default
635
+
namespace: openshift-ingress-operator
636
+
spec:
637
+
tuningOptions:
638
+
httpKeepAliveTimeout: 3d
639
+
expectedError: "IngressController.operator.openshift.io \"default\" is invalid: spec.tuningOptions.httpKeepAliveTimeout: Invalid value: \"string\": httpKeepAliveTimeout must be a valid duration string composed of an unsigned integer value, optionally followed by a decimal fraction and a unit suffix (ms, s, m)"
640
+
- name: Should not be able to create an IngressController with invalid space httpKeepAlive timeout
641
+
initial: |
642
+
apiVersion: operator.openshift.io/v1
643
+
kind: IngressController
644
+
metadata:
645
+
name: default
646
+
namespace: openshift-ingress-operator
647
+
spec:
648
+
tuningOptions:
649
+
httpKeepAliveTimeout: "4 s"
650
+
expectedError: "IngressController.operator.openshift.io \"default\" is invalid: spec.tuningOptions.httpKeepAliveTimeout: Invalid value: \"string\": httpKeepAliveTimeout must be a valid duration string composed of an unsigned integer value, optionally followed by a decimal fraction and a unit suffix (ms, s, m)"
651
+
- name: Should not be able to create an IngressController with httpKeepAlive timeout too big
652
+
initial: |
653
+
apiVersion: operator.openshift.io/v1
654
+
kind: IngressController
655
+
metadata:
656
+
name: default
657
+
namespace: openshift-ingress-operator
658
+
spec:
659
+
tuningOptions:
660
+
httpKeepAliveTimeout: 100m
661
+
expectedError: "IngressController.operator.openshift.io \"default\" is invalid: spec.tuningOptions.httpKeepAliveTimeout: Invalid value: \"string\": httpKeepAliveTimeout must be less than or equal to 15 minutes"
662
+
- name: Should not be able to create an IngressController with httpKeepAlive timeout too small
663
+
initial: |
664
+
apiVersion: operator.openshift.io/v1
665
+
kind: IngressController
666
+
metadata:
667
+
name: default
668
+
namespace: openshift-ingress-operator
669
+
spec:
670
+
tuningOptions:
671
+
httpKeepAliveTimeout: 0.001ms
672
+
expectedError: "IngressController.operator.openshift.io \"default\" is invalid: spec.tuningOptions.httpKeepAliveTimeout: Invalid value: \"string\": httpKeepAliveTimeout must be greater than or equal to 1 millisecond"
566
673
- name: Should be able to create an IngressController with valid domain
// httpKeepAliveTimeout defines the maximum allowed time to wait for
1888
+
// a new HTTP request to appear on a connection from the client to the router.
1889
+
//
1890
+
// This field expects an unsigned duration string of a decimal number, with optional
1891
+
// fraction and a unit suffix, e.g. "300ms", "1.5s" or "2m45s".
1892
+
// Valid time units are "ms", "s", "m".
1893
+
// The allowed range is from 1 millisecond to 15 minutes.
1894
+
//
1895
+
// When omitted, this means the user has no opinion and the platform is left
1896
+
// to choose a reasonable default. This default is subject to change over time.
1897
+
// The current default is 300s.
1898
+
//
1899
+
// Low values (tens of milliseconds or less) can cause clients to close and reopen connections
1900
+
// for each request, leading to reduced connection sharing.
1901
+
// For HTTP/2, special care should be taken with low values.
1902
+
// A few seconds is a reasonable starting point to avoid holding idle connections open
1903
+
// while still allowing subsequent requests to reuse the connection.
1904
+
//
1905
+
// High values (minutes or more) favor connection reuse but may cause idle
1906
+
// connections to linger longer.
1907
+
//
1908
+
// +kubebuilder:validation:Type:=string
1909
+
// +kubebuilder:validation:XValidation:rule="self.matches('^([0-9]+(\\\\.[0-9]+)?(ms|s|m))+$')",message="httpKeepAliveTimeout must be a valid duration string composed of an unsigned integer value, optionally followed by a decimal fraction and a unit suffix (ms, s, m)"
1910
+
// +kubebuilder:validation:XValidation:rule="!self.matches('^([0-9]+(\\\\.[0-9]+)?(ms|s|m))+$') || duration(self) <= duration('15m')",message="httpKeepAliveTimeout must be less than or equal to 15 minutes"
1911
+
// +kubebuilder:validation:XValidation:rule="!self.matches('^([0-9]+(\\\\.[0-9]+)?(ms|s|m))+$') || duration(self) >= duration('1ms')",message="httpKeepAliveTimeout must be greater than or equal to 1 millisecond"
0 commit comments