-
Notifications
You must be signed in to change notification settings - Fork 585
operator/ingress: Add logging API #616
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
operator/ingress: Add logging API #616
Conversation
12a2b6a to
776efe2
Compare
f57c68d to
307c0bf
Compare
|
Latest push replaces the I added a patch file to do the required validation because I couldn't figure out how to do it using kubebuilder markers. In order to get An alternative would be to use a regexp, which would be very messy to match IPv4 and IPv6 addresses. |
This commit implements NE-284. https://issues.redhat.com/browse/NE-284 * operator/v1/types_ingress.go (IngressControllerSpec): Add Logging field with the new IngressControllerLogging type. (LoggingDestinationType): New type. (ContainerLoggingDestinationType, SyslogLoggingDestinationType): New constants to identify types of destinations for log messages. (ContainerLoggingSidecarContainerName): New constant. (SyslogLoggingDestinationParameters): New type. Describe a syslog endpoint and facility. (ContainerLoggingDestinationParameters): New type. Empty for now. (LoggingDestination): New type. Describe a destination for log messages using LoggingDestinationType, SyslogLoggingDestinationParameters, and ContainerLoggingDestinationParameters. (AccessLogging): New type. Describe how client requests are logged, using LoggingDestination. (IngressControllerLogging): New type. Describe what should be logged where, using AccessLogging. For now, other types of logging cannot be specified. * operator/v1/0000_50_ingress-operator_00-custom-resource-definition.yaml: Rename... * operator/v1/0000_50_ingress-operator_00-ingresscontroller.crd.yaml: ...to this. The file name must end in .crd.yaml so it can be patched. * operator/v1/0000_50_ingress-operator_00-ingresscontroller.crd.yaml-merge-patch: New file. Patch the validation of the spec.logging.access.destination.syslog.address field to require its value to be either ipv4 or ipv6 * operator/v1/zz_generated.deepcopy.go: * operator/v1/zz_generated.swagger_doc_generated.go: Regenerate.
307c0bf to
1fc310b
Compare
| // | ||
| // +kubebuilder:validation:Required | ||
| // +required | ||
| Address string `json:"address"` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There is an URL. Otherwise, we split host and port usually, don't we?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
By "split host and port", do you mean using separate fields? I changed to using separate fields to enable us to perform stricter validation. Our goal is to perform as much validation as possible using OpenAPI.
|
/approve Any other feedback? @openshift/sig-network-edge |
|
/lgtm |
|
/approve |
|
Whoops, I don't have the power :) |
|
/approve |
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: ironcladlou, knobunc, Miciah The full list of commands accepted by this bot can be found here. The pull request process is described here DetailsNeeds approval from an approver in each of these files:
Approvers can indicate their approval by writing |
|
All jobs are failing with the following: /retest |
|
/retest |
1 similar comment
|
/retest |
There's an enhancement proposal for this profile [1], and the Code Ready Containers folks took a run at using it in [2] before backing off in [3]. I don't have any problems with having a specific CRC profile, but until we end up going that way, save ourselves the mental overhead of trying to guess whether it will want each of our manifest resources by dropping the annotation across the board. Effectively reverts abd8a20 (Annotate manifests for single-node-developer cluster profile, 2020-11-27, openshift#498). Generated with: $ sed -i '/single-node-developer/d' manifests/*.yaml $ git checkout HEAD -- manifests/00-custom-resource-definition.yaml where I'm leaving the CRD alone to avoid [4]: hack/verify-generated-crd.sh --- vendor/github.com/openshift/api/operator/v1/0000_50_ingress-operator_00-ingresscontroller.crd.yaml 2021-12-22 07:10:24.000000000 +0000 +++ manifests/00-custom-resource-definition.yaml 2021-12-22 07:10:25.000000000 +0000 @@ -5,7 +5,6 @@ metadata: api-approved.openshift.io: openshift/api#616 include.release.openshift.io/ibm-cloud-managed: "true" include.release.openshift.io/self-managed-high-availability: "true" - include.release.openshift.io/single-node-developer: "true" name: ingresscontrollers.operator.openshift.io spec: group: operator.openshift.io invalid CRD: vendor/github.com/openshift/api/operator/v1/0000_50_ingress-operator_00-ingresscontroller.crd.yaml => manifests/00-custom-resource-definition.yaml [1]: https://github.com/openshift/enhancements/blob/2911c46bf7d2f22eb1ab81739b4f9c2603fd0c07/enhancements/single-node/developer-cluster-profile.md [2]: crc-org/snc#338 [3]: crc-org/snc#373 (comment) [4]: https://prow.ci.openshift.org/view/gs/origin-ci-test/pr-logs/pull/openshift_cluster-ingress-operator/692/pull-ci-openshift-cluster-ingress-operator-master-verify/1473551168843026432#1:build-log.txt%3A14
There's an enhancement proposal for this profile [1], and the Code Ready Containers folks took a run at using it in [2] before backing off in [3]. I don't have any problems with having a specific CRC profile, but until we end up going that way, save ourselves the mental overhead of trying to guess whether it will want each of our manifest resources by dropping the annotation across the board. Effectively reverts abd8a20 (Annotate manifests for single-node-developer cluster profile, 2020-11-27, openshift#498). Generated with: $ sed -i '/single-node-developer/d' manifests/*.yaml $ git checkout HEAD -- manifests/00-custom-resource-definition* where I'm leaving the CRDs alone to avoid things like [4]: hack/verify-generated-crd.sh --- vendor/github.com/openshift/api/operator/v1/0000_50_ingress-operator_00-ingresscontroller.crd.yaml 2021-12-22 07:10:24.000000000 +0000 +++ manifests/00-custom-resource-definition.yaml 2021-12-22 07:10:25.000000000 +0000 @@ -5,7 +5,6 @@ metadata: api-approved.openshift.io: openshift/api#616 include.release.openshift.io/ibm-cloud-managed: "true" include.release.openshift.io/self-managed-high-availability: "true" - include.release.openshift.io/single-node-developer: "true" name: ingresscontrollers.operator.openshift.io spec: group: operator.openshift.io invalid CRD: vendor/github.com/openshift/api/operator/v1/0000_50_ingress-operator_00-ingresscontroller.crd.yaml => manifests/00-custom-resource-definition.yaml [1]: https://github.com/openshift/enhancements/blob/2911c46bf7d2f22eb1ab81739b4f9c2603fd0c07/enhancements/single-node/developer-cluster-profile.md [2]: crc-org/snc#338 [3]: crc-org/snc#373 (comment) [4]: https://prow.ci.openshift.org/view/gs/origin-ci-test/pr-logs/pull/openshift_cluster-ingress-operator/692/pull-ci-openshift-cluster-ingress-operator-master-verify/1473551168843026432#1:build-log.txt%3A14
This commit implements NE-284.
operator/v1/types_ingress.go(IngressControllerSpec): AddLoggingfield with the newIngressControllerLoggingtype.(
LoggingDestinationType): New type.(
ContainerLoggingDestinationType,SyslogLoggingDestinationType): New constants to identify types of destinations for log messages.(
ContainerLoggingSidecarContainerName): New constant.(
SyslogLoggingDestinationParameters): New type. Describe a syslog endpoint and facility.(
ContainerLoggingDestinationParameters): New type. Empty for now.(
LoggingDestination): New type. Describe a destination for log messages usingLoggingDestinationType,SyslogLoggingDestinationParameters, andContainerLoggingDestinationParameters.(
AccessLogging): New type. Describe how client requests are logged, usingLoggingDestination.(
IngressControllerLogging): New type. Describe what should be logged where, usingAccessLogging. For now, other types of logging cannot be specified.operator/v1/0000_50_ingress-operator_00-custom-resource-definition.yaml:operator/v1/zz_generated.deepcopy.go:operator/v1/zz_generated.swagger_doc_generated.go: Regenerate.