Bug 2106086
| Summary: | IngressController spec.tuningOptions.healthCheckInterval validation allows invalid values such as "0abc" | ||
|---|---|---|---|
| Product: | OpenShift Container Platform | Reporter: | Miciah Dashiel Butler Masters <mmasters> |
| Component: | Networking | Assignee: | Miciah Dashiel Butler Masters <mmasters> |
| Networking sub component: | router | QA Contact: | Hongan Li <hongli> |
| Status: | CLOSED ERRATA | Docs Contact: | |
| Severity: | urgent | ||
| Priority: | high | CC: | bbennett, hongli, wking |
| Version: | 4.11 | ||
| Target Milestone: | --- | ||
| Target Release: | 4.12.0 | ||
| Hardware: | Unspecified | ||
| OS: | Unspecified | ||
| Whiteboard: | |||
| Fixed In Version: | Doc Type: | No Doc Update | |
| Doc Text: | Story Points: | --- | |
| Clone Of: | Environment: | ||
| Last Closed: | 2023-01-17 19:52:29 UTC | Type: | Bug |
| Regression: | --- | Mount Type: | --- |
| Documentation: | --- | CRM: | |
| Verified Versions: | Category: | --- | |
| oVirt Team: | --- | RHEL 7.3 requirements from Atomic Host: | |
| Cloudforms Team: | --- | Target Upstream Version: | |
| Embargoed: | |||
| Bug Depends On: | |||
| Bug Blocks: | 2106116 | ||
verified with 4.12.0-0.ci-2022-07-13-214326 and passed.
$ oc get clusterversion
NAME VERSION AVAILABLE PROGRESSING SINCE STATUS
version 4.12.0-0.ci-2022-07-13-214326 True False 97m Cluster version is 4.12.0-0.ci-2022-07-13-214326
$ oc -n openshift-ingress-operator patch ingresscontroller/default --type=merge --patch='{"spec":{"tuningOptions":{"healthCheckInterval":"0abc"}}}'
The IngressController "default" is invalid: spec.tuningOptions.healthCheckInterval: Invalid value: "0abc": spec.tuningOptions.healthCheckInterval in body should match '^(0|([0-9]+(\.[0-9]+)?(ns|us|µs|μs|ms|s|m|h))+)$'
No doc update is required because this was an issue in a new API. Since the problem described in this bug report should be resolved in a recent advisory, it has been closed with a resolution of ERRATA. For information on the advisory (Moderate: OpenShift Container Platform 4.12.0 bug fix and security update), and where to find the updated files, follow the link below. If the solution does not work for you, open a new bug report. https://access.redhat.com/errata/RHSA-2022:7399 |
Description of problem: OpenShift 4.11 adds a new API field to IngressController: spec.tuningOptions.healthCheckInterval. This field has the following validation: // +kubebuilder:validation:Pattern=^0|([0-9]+(\.[0-9]+)?(ns|us|µs|μs|ms|s|m|h))+$ Note that the left subgroup includes the "^" anchor, and the right subgroup includes the "$" anchor. The validation should be the following: // +kubebuilder:validation:Pattern=^(0|([0-9]+(\.[0-9]+)?(ns|us|µs|μs|ms|s|m|h))+)$ OpenShift release version: 4.11.0 Cluster Platform: All platforms. How reproducible: Easily. Steps to Reproduce (in detail): 1. Set a value for spec.tuningOptions.healthCheckInterval with a leading 0 and any arbitrary suffix. Actual results: Any value with a leading 0 is accepted: % oc -n openshift-ingress-operator patch ingresscontroller/default --type=merge --patch='{"spec":{"tuningOptions":{"healthCheckInterval":"0abc"}}}' ingresscontroller.operator.openshift.io/default patched Expected results: Only 0 or a number with an optional decimal part and with a unit should be accepted: % oc -n openshift-ingress-operator patch ingresscontroller/default --type=merge --patch='{"spec":{"tuningOptions":{"healthCheckInterval":"0abc"}}}' The IngressController "default" is invalid: spec.tuningOptions.healthCheckInterval: Invalid value: "0abc": spec.tuningOptions.healthCheckInterval in body should match '^(0|([0-9]+(\.[0-9]+)?(ns|us|µs|μs|ms|s|m|h))+)$' Impact of the problem: Users can set invalid values. Additional info: This API field is new in OpenShift 4.11.0.