Skip to content

Commit 01df9de

Browse files
committed
operator/ingress: Add httpLogFormat validation
* operator/v1/tests/ingresscontrollers.operator.openshift.io/AAA_ungated.yaml: Add some integration tests for IngressController.spec.logging.access.httpLogFormat. * operator/v1/types_ingress.go (AccessLogging): Add a kubebuilder validation pattern to the httpLogFormat field. * operator/v1/zz_generated.crd-manifests/0000_50_ingress_00_ingresscontrollers-CustomNoUpgrade.crd.yaml: * operator/v1/zz_generated.featuregated-crd-manifests/ingresscontrollers.operator.openshift.io/AAA_ungated.yaml: * operator/v1/zz_generated.featuregated-crd-manifests/ingresscontrollers.operator.openshift.io/IngressControllerDynamicConfigurationManager.yaml: Regenerate.
1 parent f7b3bd9 commit 01df9de

5 files changed

Lines changed: 70 additions & 0 deletions

File tree

operator/v1/tests/ingresscontrollers.operator.openshift.io/AAA_ungated.yaml

Lines changed: 66 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -738,6 +738,72 @@ tests:
738738
spec:
739739
domain: "this-domain.has-208-characters.which-on.its-own-would-not-exceed.the-limit-of-253-chars.but-combined-with-the-ingress-controller-name.with-40-chars.and-the-router-prefix.ends-up-as-a-too-long.canonical-domain"
740740
expectedError: "The combined 'router-' + metadata.name + '.' + .spec.domain cannot exceed 253 characters"
741+
- name: Should be able to create an IngressController with TCP log format
742+
initial: |
743+
apiVersion: operator.openshift.io/v1
744+
kind: IngressController
745+
spec:
746+
logging:
747+
access:
748+
destination:
749+
type: Container
750+
httpLogFormat: "%ci:%cp [%t] %ft %b/%s %Tw/%Tc/%Tt %B %ts %ac/%fc/%bc/%sc/%rc %sq/%bq"
751+
expected: |
752+
apiVersion: operator.openshift.io/v1
753+
kind: IngressController
754+
spec:
755+
httpEmptyRequestsPolicy: Respond
756+
idleConnectionTerminationPolicy: Immediate
757+
closedClientConnectionPolicy: Continue
758+
logging:
759+
access:
760+
destination:
761+
type: Container
762+
httpLogFormat: "%ci:%cp [%t] %ft %b/%s %Tw/%Tc/%Tt %B %ts %ac/%fc/%bc/%sc/%rc %sq/%bq"
763+
- name: Should be able to create an IngressController with HTTP log format
764+
initial: |
765+
apiVersion: operator.openshift.io/v1
766+
kind: IngressController
767+
spec:
768+
logging:
769+
access:
770+
destination:
771+
type: Container
772+
httpLogFormat: "%ci:%cp [%tr] %ft %b/%s %TR/%Tw/%Tc/%Tr/%Ta %ST %B %CC %CS %tsc %ac/%fc/%bc/%sc/%rc %sq/%bq %hr %hs %{+Q}r"
773+
expected: |
774+
apiVersion: operator.openshift.io/v1
775+
kind: IngressController
776+
spec:
777+
httpEmptyRequestsPolicy: Respond
778+
idleConnectionTerminationPolicy: Immediate
779+
closedClientConnectionPolicy: Continue
780+
logging:
781+
access:
782+
destination:
783+
type: Container
784+
httpLogFormat: "%ci:%cp [%tr] %ft %b/%s %TR/%Tw/%Tc/%Tr/%Ta %ST %B %CC %CS %tsc %ac/%fc/%bc/%sc/%rc %sq/%bq %hr %hs %{+Q}r"
785+
- name: Should be able to create an IngressController with HTTPS log format
786+
initial: |
787+
apiVersion: operator.openshift.io/v1
788+
kind: IngressController
789+
spec:
790+
logging:
791+
access:
792+
destination:
793+
type: Container
794+
httpLogFormat: "%ci:%cp [%tr] %ft %b/%s %TR/%Tw/%Tc/%Tr/%Ta %ST %B %CC %CS %tsc %ac/%fc/%bc/%sc/%rc %sq/%bq %hr %hs %{+Q}r %[fc_err]/%[ssl_fc_err,hex]/%[ssl_c_err]/%[ssl_c_ca_err]/%[ssl_fc_is_resumed] %[ssl_fc_sni]/%sslv/%sslc"
795+
expected: |
796+
apiVersion: operator.openshift.io/v1
797+
kind: IngressController
798+
spec:
799+
httpEmptyRequestsPolicy: Respond
800+
idleConnectionTerminationPolicy: Immediate
801+
closedClientConnectionPolicy: Continue
802+
logging:
803+
access:
804+
destination:
805+
type: Container
806+
httpLogFormat: "%ci:%cp [%tr] %ft %b/%s %TR/%Tw/%Tc/%Tr/%Ta %ST %B %CC %CS %tsc %ac/%fc/%bc/%sc/%rc %sq/%bq %hr %hs %{+Q}r %[fc_err]/%[ssl_fc_err,hex]/%[ssl_c_err]/%[ssl_c_ca_err]/%[ssl_fc_is_resumed] %[ssl_fc_sni]/%sslv/%sslc"
741807
onUpdate:
742808
- name: Should be able to update invalid domain to a valid domain
743809
initialCRDPatches:

0 commit comments

Comments
 (0)