-
Bug
-
Resolution: Done-Errata
-
Minor
-
4.13, 4.12, 4.11, 4.14, 4.15, 4.16
-
Informational
-
No
-
2
-
Sprint 252
-
1
-
Rejected
-
False
-
-
-
Bug Fix
-
Done
Description of problem
The API documentation for the status.componentRoutes.currentHostnames field in the ingress config API has developer notes from the Go definition.
Version-Release number of selected component (if applicable)
OpenShift 4.11 and all subsequent versions of OpenShift so far.
How reproducible
100%.
Steps to Reproduce
1. Read the documentation for the API field: oc explain ingresses.status.componentRoutes.currentHostnames --api-version=config.openshift.io/v1
Actual results
The ingresses.config.openshift.io CRD has developer notes in the description of the status.componentRoutes.currentHostnames field:
% oc explain ingresses.status.componentRoutes.currentHostnames --api-version=config.openshift.io/v1 KIND: Ingress VERSION: config.openshift.io/v1 FIELD: currentHostnames <[]string> DESCRIPTION: currentHostnames is the list of current names used by the route. Typically, this list should consist of a single hostname, but if multiple hostnames are supported by the route the operator may write multiple entries to this list. Hostname is an alias for hostname string validation. The left operand of the | is the original kubebuilder hostname validation format, which is incorrect because it allows upper case letters, disallows hyphen or number in the TLD, and allows labels to start/end in non-alphanumeric characters. See https://bugzilla.redhat.com/show_bug.cgi?id=2039256. ^([a-zA-Z0-9\p{S}\p{L}]((-?[a-zA-Z0-9\p{S}\p{L}]{0,62})?)|([a-zA-Z0-9\p{S}\p{L}](([a-zA-Z0-9-\p{S}\p{L}]{0,61}[a-zA-Z0-9\p{S}\p{L}])?)(\.)){1,}([a-zA-Z\p{L}]){2,63})$ The right operand of the | is a new pattern that mimics the current API route admission validation on hostname, except that it allows hostnames longer than the maximum length: ^(([a-z0-9][-a-z0-9]{0,61}[a-z0-9]|[a-z0-9]{1,63})[\.]){0,}([a-z0-9][-a-z0-9]{0,61}[a-z0-9]|[a-z0-9]{1,63})$ Both operand patterns are made available so that modifications on ingress spec can still happen after an invalid hostname was saved via validation by the incorrect left operand of the | operator.
Expected results
The second paragraph should be omitted from the CRD:
% oc explain ingresses.status.componentRoutes.currentHostnames --api-version=config.openshift.io/v1 KIND: Ingress VERSION: config.openshift.io/v1 FIELD: currentHostnames <[]string> DESCRIPTION: currentHostnames is the list of current names used by the route. Typically, this list should consist of a single hostname, but if multiple hostnames are supported by the route the operator may write multiple entries to this list.
Additional info
The API field was introduced in OpenShift 4.8: https://github.com/openshift/api/pull/852/commits/c53c57f3d465f28b27ee4fad48763f049228486e
The developer note was added in OpenShift 4.11: https://github.com/openshift/api/pull/1120/commits/1fec415423985530a8925a5fd8c87e1741d8c2fb
- links to
-
RHEA-2024:0041 OpenShift Container Platform 4.16.z bug fix update