Skip to content

Commit a113767

Browse files
committed
NE-2117: Add httpsLogFormat and tcpLogFormat to API
1 parent b3abc73 commit a113767

23 files changed

+3591
-16
lines changed

features.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,7 @@
6868
| HyperShiftOnlyDynamicResourceAllocation| <span style="background-color: #519450">Enabled</span> | | <span style="background-color: #519450">Enabled</span> | | <span style="background-color: #519450">Enabled</span> | | <span style="background-color: #519450">Enabled</span> | |
6969
| ImageModeStatusReporting| | | <span style="background-color: #519450">Enabled</span> | <span style="background-color: #519450">Enabled</span> | | | <span style="background-color: #519450">Enabled</span> | <span style="background-color: #519450">Enabled</span> |
7070
| IngressControllerDynamicConfigurationManager| | | <span style="background-color: #519450">Enabled</span> | <span style="background-color: #519450">Enabled</span> | | | <span style="background-color: #519450">Enabled</span> | <span style="background-color: #519450">Enabled</span> |
71+
| IngressControllerHTTPSLogFormat| | | <span style="background-color: #519450">Enabled</span> | <span style="background-color: #519450">Enabled</span> | | | <span style="background-color: #519450">Enabled</span> | <span style="background-color: #519450">Enabled</span> |
7172
| IrreconcilableMachineConfig| | | <span style="background-color: #519450">Enabled</span> | <span style="background-color: #519450">Enabled</span> | | | <span style="background-color: #519450">Enabled</span> | <span style="background-color: #519450">Enabled</span> |
7273
| KMSEncryption| | | <span style="background-color: #519450">Enabled</span> | <span style="background-color: #519450">Enabled</span> | | | <span style="background-color: #519450">Enabled</span> | <span style="background-color: #519450">Enabled</span> |
7374
| MachineAPIMigration| | | <span style="background-color: #519450">Enabled</span> | <span style="background-color: #519450">Enabled</span> | | | <span style="background-color: #519450">Enabled</span> | <span style="background-color: #519450">Enabled</span> |

features/features.go

Lines changed: 14 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -203,12 +203,12 @@ var (
203203
mustRegister()
204204

205205
FeatureGateNoOverlayMode = newFeatureGate("NoOverlayMode").
206-
reportProblemsToJiraComponent("Networking/ovn-kubernetes").
207-
contactPerson("pliurh").
208-
productScope(ocpSpecific).
209-
enhancementPR("https://github.com/openshift/enhancements/pull/1859").
210-
enable(inDevPreviewNoUpgrade(), inTechPreviewNoUpgrade()).
211-
mustRegister()
206+
reportProblemsToJiraComponent("Networking/ovn-kubernetes").
207+
contactPerson("pliurh").
208+
productScope(ocpSpecific).
209+
enhancementPR("https://github.com/openshift/enhancements/pull/1859").
210+
enable(inDevPreviewNoUpgrade(), inTechPreviewNoUpgrade()).
211+
mustRegister()
212212

213213
FeatureGateEVPN = newFeatureGate("EVPN").
214214
reportProblemsToJiraComponent("Networking/ovn-kubernetes").
@@ -665,6 +665,14 @@ var (
665665
enable(inDevPreviewNoUpgrade(), inTechPreviewNoUpgrade()).
666666
mustRegister()
667667

668+
FeatureGateIngressControllerHTTPSLogFormat = newFeatureGate("IngressControllerHTTPSLogFormat").
669+
reportProblemsToJiraComponent("Networking / router").
670+
contactPerson("rohara").
671+
productScope(ocpSpecific).
672+
enhancementPR("https://github.com/openshift/enhancements/pull/1832").
673+
enable(inDevPreviewNoUpgrade(), inTechPreviewNoUpgrade()).
674+
mustRegister()
675+
668676
FeatureGateMinimumKubeletVersion = newFeatureGate("MinimumKubeletVersion").
669677
reportProblemsToJiraComponent("Node").
670678
contactPerson("haircommander").

openapi/generated_openapi/zz_generated.openapi.go

Lines changed: 15 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Lines changed: 67 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,67 @@
1+
apiVersion: apiextensions.k8s.io/v1 # Hack because controller-gen complains if we don't have this
2+
name: "IngressController"
3+
crdName: ingresscontrollers.operator.openshift.io
4+
featureGates:
5+
- IngressControllerHTTPSLogFormat
6+
tests:
7+
onCreate:
8+
- name: Should be able to create a minimal ingresscontroller with tcpLogFormat
9+
initial: |
10+
apiVersion: operator.openshift.io/v1
11+
kind: IngressController
12+
metadata:
13+
name: default
14+
namespace: openshift-ingress-operator
15+
spec:
16+
logging:
17+
access:
18+
destination:
19+
type: Container
20+
logEmptyRequests: "Ignore"
21+
tcpLogFormat: "%ci:%cp [%t] %ft %b/%s %Tw/%Tc/%Tt %B %ts"
22+
expected: |
23+
apiVersion: operator.openshift.io/v1
24+
kind: IngressController
25+
metadata:
26+
name: default
27+
namespace: openshift-ingress-operator
28+
spec:
29+
httpEmptyRequestsPolicy: Respond
30+
idleConnectionTerminationPolicy: Immediate
31+
closedClientConnectionPolicy: Continue
32+
logging:
33+
access:
34+
destination:
35+
type: Container
36+
logEmptyRequests: "Ignore"
37+
tcpLogFormat: "%ci:%cp [%t] %ft %b/%s %Tw/%Tc/%Tt %B %ts"
38+
- name: Should be able to create a minimal ingresscontroller with httpsLogFormat
39+
initial: |
40+
apiVersion: operator.openshift.io/v1
41+
kind: IngressController
42+
metadata:
43+
name: default
44+
namespace: openshift-ingress-operator
45+
spec:
46+
logging:
47+
access:
48+
destination:
49+
type: Container
50+
logEmptyRequests: "Ignore"
51+
httpsLogFormat: "%ci:%cp [%tr] %ft %b/%s %TR/%Tw/%Tc/%Tr/%Ta %ST %B %CC"
52+
expected: |
53+
apiVersion: operator.openshift.io/v1
54+
kind: IngressController
55+
metadata:
56+
name: default
57+
namespace: openshift-ingress-operator
58+
spec:
59+
httpEmptyRequestsPolicy: Respond
60+
idleConnectionTerminationPolicy: Immediate
61+
closedClientConnectionPolicy: Continue
62+
logging:
63+
access:
64+
destination:
65+
type: Container
66+
logEmptyRequests: "Ignore"
67+
httpsLogFormat: "%ci:%cp [%tr] %ft %b/%s %TR/%Tw/%Tc/%Tr/%Ta %ST %B %CC"

operator/v1/types_ingress.go

Lines changed: 43 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1495,13 +1495,35 @@ type AccessLogging struct {
14951495
// +required
14961496
Destination LoggingDestination `json:"destination"`
14971497

1498+
// tcpLogFormat specifies the format of the log message for a TCP
1499+
// connection.
1500+
//
1501+
// If this field is empty, log messages use the implementation's default
1502+
// TCP log format. When set, the value must be between 1 and 1024
1503+
// characters long.For HAProxy's default TCP log format, see the
1504+
// HAProxy documentation:
1505+
// http://docs.haproxy.org/2.8/configuration.html#8.2.2
1506+
//
1507+
// Note that this log message is used for the initial TCP connection
1508+
// associated with a TLS session. Note that for edge-terminated and
1509+
// reencrypt routes, you may see a second log message for the HTTP
1510+
// request in addition to the log message for the TCP connection. Use
1511+
// the httpsLogFormat option to customize the log format for the HTTPS
1512+
// request.
1513+
//
1514+
// +kubebuilder:validation:MinLength=1
1515+
// +kubebuilder:validation:MaxLength=1024
1516+
// +openshift:enable:FeatureGate=IngressControllerHTTPSLogFormat
1517+
// +optional
1518+
TcpLogFormat string `json:"tcpLogFormat,omitempty"`
1519+
14981520
// httpLogFormat specifies the format of the log message for an HTTP
14991521
// request.
15001522
//
15011523
// If this field is empty, log messages use the implementation's default
15021524
// HTTP log format. For HAProxy's default HTTP log format, see the
15031525
// HAProxy documentation:
1504-
// http://cbonte.github.io/haproxy-dconv/2.0/configuration.html#8.2.3
1526+
// http://docs.haproxy.org/2.8/configuration.html#8.2.3
15051527
//
15061528
// Note that this format only applies to cleartext HTTP connections
15071529
// and to secure HTTP connections for which the ingress controller
@@ -1512,6 +1534,26 @@ type AccessLogging struct {
15121534
// +optional
15131535
HttpLogFormat string `json:"httpLogFormat,omitempty"`
15141536

1537+
// httpsLogFormat specifies the format of the log message for an HTTPS
1538+
// request.
1539+
//
1540+
// If this field is empty, log messages use the implementation's default
1541+
// HTTPS log format. When set, the value must be between 1 and 1024
1542+
// characters long.For HAProxy's default HTTPS log format, see the
1543+
// HAProxy documentation:
1544+
// http://docs.haproxy.org/2.8/configuration.html#8.2.4
1545+
//
1546+
// Note that this format only applies to HTTPS connections for which the
1547+
// ingress controller terminates encryption (that is, edge-terminated or
1548+
// reencrypt connections). It does not affect the log format for TLS
1549+
// passthrough connections.
1550+
//
1551+
// +kubebuilder:validation:MinLength=1
1552+
// +kubebuilder:validation:MaxLength=1024
1553+
// +openshift:enable:FeatureGate=IngressControllerHTTPSLogFormat
1554+
// +optional
1555+
HttpsLogFormat string `json:"httpsLogFormat,omitempty"`
1556+
15151557
// httpCaptureHeaders defines HTTP headers that should be captured in
15161558
// access logs. If this field is empty, no headers are captured.
15171559
//

operator/v1/zz_generated.crd-manifests/0000_50_ingress_00_ingresscontrollers-CustomNoUpgrade.crd.yaml

Lines changed: 39 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1661,14 +1661,32 @@ spec:
16611661
If this field is empty, log messages use the implementation's default
16621662
HTTP log format. For HAProxy's default HTTP log format, see the
16631663
HAProxy documentation:
1664-
http://cbonte.github.io/haproxy-dconv/2.0/configuration.html#8.2.3
1664+
http://docs.haproxy.org/2.8/configuration.html#8.2.3
16651665
16661666
Note that this format only applies to cleartext HTTP connections
16671667
and to secure HTTP connections for which the ingress controller
16681668
terminates encryption (that is, edge-terminated or reencrypt
16691669
connections). It does not affect the log format for TLS passthrough
16701670
connections.
16711671
type: string
1672+
httpsLogFormat:
1673+
description: |-
1674+
httpsLogFormat specifies the format of the log message for an HTTPS
1675+
request.
1676+
1677+
If this field is empty, log messages use the implementation's default
1678+
HTTPS log format. When set, the value must be between 1 and 1024
1679+
characters long.For HAProxy's default HTTPS log format, see the
1680+
HAProxy documentation:
1681+
http://docs.haproxy.org/2.8/configuration.html#8.2.4
1682+
1683+
Note that this format only applies to HTTPS connections for which the
1684+
ingress controller terminates encryption (that is, edge-terminated or
1685+
reencrypt connections). It does not affect the log format for TLS
1686+
passthrough connections.
1687+
maxLength: 1024
1688+
minLength: 1
1689+
type: string
16721690
logEmptyRequests:
16731691
default: Log
16741692
description: |-
@@ -1686,6 +1704,26 @@ spec:
16861704
- Log
16871705
- Ignore
16881706
type: string
1707+
tcpLogFormat:
1708+
description: |-
1709+
tcpLogFormat specifies the format of the log message for a TCP
1710+
connection.
1711+
1712+
If this field is empty, log messages use the implementation's default
1713+
TCP log format. When set, the value must be between 1 and 1024
1714+
characters long.For HAProxy's default TCP log format, see the
1715+
HAProxy documentation:
1716+
http://docs.haproxy.org/2.8/configuration.html#8.2.2
1717+
1718+
Note that this log message is used for the initial TCP connection
1719+
associated with a TLS session. Note that for edge-terminated and
1720+
reencrypt routes, you may see a second log message for the HTTP
1721+
request in addition to the log message for the TCP connection. Use
1722+
the httpsLogFormat option to customize the log format for the HTTPS
1723+
request.
1724+
maxLength: 1024
1725+
minLength: 1
1726+
type: string
16891727
required:
16901728
- destination
16911729
type: object

operator/v1/zz_generated.crd-manifests/0000_50_ingress_00_ingresscontrollers-Default.crd.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1661,7 +1661,7 @@ spec:
16611661
If this field is empty, log messages use the implementation's default
16621662
HTTP log format. For HAProxy's default HTTP log format, see the
16631663
HAProxy documentation:
1664-
http://cbonte.github.io/haproxy-dconv/2.0/configuration.html#8.2.3
1664+
http://docs.haproxy.org/2.8/configuration.html#8.2.3
16651665
16661666
Note that this format only applies to cleartext HTTP connections
16671667
and to secure HTTP connections for which the ingress controller

operator/v1/zz_generated.crd-manifests/0000_50_ingress_00_ingresscontrollers-DevPreviewNoUpgrade.crd.yaml

Lines changed: 39 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1661,14 +1661,32 @@ spec:
16611661
If this field is empty, log messages use the implementation's default
16621662
HTTP log format. For HAProxy's default HTTP log format, see the
16631663
HAProxy documentation:
1664-
http://cbonte.github.io/haproxy-dconv/2.0/configuration.html#8.2.3
1664+
http://docs.haproxy.org/2.8/configuration.html#8.2.3
16651665
16661666
Note that this format only applies to cleartext HTTP connections
16671667
and to secure HTTP connections for which the ingress controller
16681668
terminates encryption (that is, edge-terminated or reencrypt
16691669
connections). It does not affect the log format for TLS passthrough
16701670
connections.
16711671
type: string
1672+
httpsLogFormat:
1673+
description: |-
1674+
httpsLogFormat specifies the format of the log message for an HTTPS
1675+
request.
1676+
1677+
If this field is empty, log messages use the implementation's default
1678+
HTTPS log format. When set, the value must be between 1 and 1024
1679+
characters long.For HAProxy's default HTTPS log format, see the
1680+
HAProxy documentation:
1681+
http://docs.haproxy.org/2.8/configuration.html#8.2.4
1682+
1683+
Note that this format only applies to HTTPS connections for which the
1684+
ingress controller terminates encryption (that is, edge-terminated or
1685+
reencrypt connections). It does not affect the log format for TLS
1686+
passthrough connections.
1687+
maxLength: 1024
1688+
minLength: 1
1689+
type: string
16721690
logEmptyRequests:
16731691
default: Log
16741692
description: |-
@@ -1686,6 +1704,26 @@ spec:
16861704
- Log
16871705
- Ignore
16881706
type: string
1707+
tcpLogFormat:
1708+
description: |-
1709+
tcpLogFormat specifies the format of the log message for a TCP
1710+
connection.
1711+
1712+
If this field is empty, log messages use the implementation's default
1713+
TCP log format. When set, the value must be between 1 and 1024
1714+
characters long.For HAProxy's default TCP log format, see the
1715+
HAProxy documentation:
1716+
http://docs.haproxy.org/2.8/configuration.html#8.2.2
1717+
1718+
Note that this log message is used for the initial TCP connection
1719+
associated with a TLS session. Note that for edge-terminated and
1720+
reencrypt routes, you may see a second log message for the HTTP
1721+
request in addition to the log message for the TCP connection. Use
1722+
the httpsLogFormat option to customize the log format for the HTTPS
1723+
request.
1724+
maxLength: 1024
1725+
minLength: 1
1726+
type: string
16891727
required:
16901728
- destination
16911729
type: object

operator/v1/zz_generated.crd-manifests/0000_50_ingress_00_ingresscontrollers-OKD.crd.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1661,7 +1661,7 @@ spec:
16611661
If this field is empty, log messages use the implementation's default
16621662
HTTP log format. For HAProxy's default HTTP log format, see the
16631663
HAProxy documentation:
1664-
http://cbonte.github.io/haproxy-dconv/2.0/configuration.html#8.2.3
1664+
http://docs.haproxy.org/2.8/configuration.html#8.2.3
16651665
16661666
Note that this format only applies to cleartext HTTP connections
16671667
and to secure HTTP connections for which the ingress controller

0 commit comments

Comments
 (0)