Note: This bug is displayed in read-only format because the product is no longer active in Red Hat Bugzilla.

Bug 2082428

Summary: oc patch healthCheckInterval with invalid "5 s" to the ingress-controller successfully
Product: OpenShift Container Platform Reporter: Shudi Li <shudili>
Component: NetworkingAssignee: Candace Holman <cholman>
Networking sub component: router QA Contact: Shudi Li <shudili>
Status: CLOSED ERRATA Docs Contact:
Severity: low    
Priority: high CC: cholman, hongli, mmasters, wking
Version: 4.11Keywords: Reopened
Target Milestone: ---   
Target Release: 4.11.0   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: No Doc Update
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2022-08-10 11:10:37 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:

Description Shudi Li 2022-05-06 06:46:21 UTC
Description of problem: From PR1127, for the healthCheckInterval, valid time units are "ns", "us" (or "µs"), "ms", "s", "m", "h"." But healthCheckInterval with invalid unit, for example 5d, can be patched successfully. Error or warning message should pop up when tried to configure it with the invalid unit


https://github.com/openshift/api/pull/1127/files


OpenShift release version:


Cluster Platform:


How reproducible:


Steps to Reproduce (in detail):
1.
% oc get clusterversion
NAME      VERSION                              AVAILABLE   PROGRESSING   SINCE   STATUS
version   4.11.0-0.nightly-2022-05-05-015322   True        False         4h55m   Cluster version is 4.11.0-0.nightly-2022-05-05-015322
% 

2. try to patch healthCheckInterval with 3d to the ingress-controller(3d is invalid, valid time units are "ns", "us" (or "µs"), "ms", "s", "m", "h".)
%oc -n openshift-ingress-operator patch ingresscontroller/default --type=merge -p '{"spec":{"tuningOptions": {"healthCheckInterval": "3d"}}}'  
ingresscontroller.operator.openshift.io/default patched
% 

3.
%oc -n openshift-ingress-operator get ingresscontroller/default -o yaml | grep -A1 tuningOptions
  tuningOptions:
    healthCheckInterval: 3d
%

4.oc rsh to a router pod, and check the env ROUTER_BACKEND_CHECK_INTERVAL, it is 50s, which has been set before.
% oc -n openshift-ingress get pods                               
NAME                              READY   STATUS    RESTARTS   AGE
router-default-6cfc84cd9f-689lw   1/1     Running   0          5m3s
router-default-6cfc84cd9f-w8qmc   1/1     Running   0          5m3s
% oc -n openshift-ingress rsh router-default-6cfc84cd9f-689lw
sh-4.4$ env | grep ROUTER_BACKEND_CHECK_INTERVAL
ROUTER_BACKEND_CHECK_INTERVAL=50s
sh-4.4$


Actual results:
"healthCheckInterval: 3d" can be patched to the ingress-controller

Expected results:
shouldn't be allowed, error or warning message should pop up when tried to configure it with the invalid unit

Impact of the problem:


Additional info:



** Please do not disregard the report template; filling the template out as much as possible will allow us to help you. Please consider attaching a must-gather archive (via `oc adm must-gather`). Please review must-gather contents for sensitive information before attaching any must-gathers to a bugzilla report.  You may also mark the bug private if you wish.

Comment 1 Shudi Li 2022-05-06 06:59:29 UTC
can patch it with "5 s", which having blank character and should be invalid.
1.
% oc -n openshift-ingress-operator patch ingresscontroller/default --type=merge -p '{"spec":{"tuningOptions": {"healthCheckInterval": "5 s"}}}'
ingresscontroller.operator.openshift.io/default patched
%

2.
%oc -n openshift-ingress-operator get ingresscontroller/default -o yaml | grep -A1 tuningOptions                                             
  tuningOptions:
    healthCheckInterval: 5 s
% 

3.
% oc -n openshift-ingress get pods                                                                                                             
NAME                              READY   STATUS    RESTARTS   AGE
router-default-6cfc84cd9f-689lw   1/1     Running   0          53m
router-default-6cfc84cd9f-w8qmc   1/1     Running   0          53m
%

Comment 7 Miciah Dashiel Butler Masters 2022-05-31 16:08:07 UTC
*** Bug 2091551 has been marked as a duplicate of this bug. ***

Comment 9 Shudi Li 2022-06-20 02:34:11 UTC
Verified it with 4.11.0-0.nightly-2022-06-15-222801

1.
% oc get clusterversion
NAME      VERSION                              AVAILABLE   PROGRESSING   SINCE   STATUS
version   4.11.0-0.nightly-2022-06-15-222801   True        False         10h     Cluster version is 4.11.0-0.nightly-2022-06-15-222801
%

2.
 % oc -n openshift-ingress-operator get ingresscontroller/default -o yaml | grep -A1 tuningOptions
  tuningOptions:
    healthCheckInterval: 10s
% 

3. Tried to patch it with "10 s" and "5 s"
% oc -n openshift-ingress-operator patch ingresscontroller/default --type=merge -p '{"spec": {"tuningOptions": {"healthCheckInterval": "10 s"}}}'
The IngressController "default" is invalid: spec.tuningOptions.healthCheckInterval: Invalid value: "10 s": spec.tuningOptions.healthCheckInterval in body should match '^0|([0-9]+(\.[0-9]+)?(ns|us|µs|μs|ms|s|m|h))+$'
% oc -n openshift-ingress-operator patch ingresscontroller/default --type=merge -p '{"spec": {"tuningOptions": {"healthCheckInterval": "5 s"}}}' 
The IngressController "default" is invalid: spec.tuningOptions.healthCheckInterval: Invalid value: "5 s": spec.tuningOptions.healthCheckInterval in body should match '^0|([0-9]+(\.[0-9]+)?(ns|us|µs|μs|ms|s|m|h))+$'
% 

4. Tried to patch it with "3d"
% oc -n openshift-ingress-operator patch ingresscontroller/default --type=merge -p '{"spec": {"tuningOptions": {"healthCheckInterval": "3d"}}}'  
The IngressController "default" is invalid: spec.tuningOptions.healthCheckInterval: Invalid value: "3d": spec.tuningOptions.healthCheckInterval in body should match '^0|([0-9]+(\.[0-9]+)?(ns|us|µs|μs|ms|s|m|h))+$'
%

Comment 11 errata-xmlrpc 2022-08-10 11:10:37 UTC
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 (Important: OpenShift Container Platform 4.11.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:5069