Bug 2082428 - oc patch healthCheckInterval with invalid "5 s" to the ingress-controller successfully
Summary: oc patch healthCheckInterval with invalid "5 s" to the ingress-controller suc...
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: OpenShift Container Platform
Classification: Red Hat
Component: Networking
Version: 4.11
Hardware: Unspecified
OS: Unspecified
high
low
Target Milestone: ---
: 4.11.0
Assignee: Candace Holman
QA Contact: Shudi Li
URL:
Whiteboard:
: 2091551 (view as bug list)
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2022-05-06 06:46 UTC by Shudi Li
Modified: 2022-08-10 11:11 UTC (History)
4 users (show)

Fixed In Version:
Doc Type: No Doc Update
Doc Text:
Clone Of:
Environment:
Last Closed: 2022-08-10 11:10:37 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Github openshift api pull 1197 0 None Merged Bug 2082428: healthCheckInterval accepts invalid duration values 2022-05-19 17:59:38 UTC
Github openshift cluster-ingress-operator pull 762 0 None Merged Bug 2082428: Add MicroSecond processing 2022-06-08 22:05:08 UTC
Red Hat Product Errata RHSA-2022:5069 0 None None None 2022-08-10 11:11:11 UTC

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


Note You need to log in before you can comment on or make changes to this bug.