Description of problem: A value of `2%0` for the MHC MaxUnhealthy field is currently interpreted the same way `50%` would be, even though it is malformed. Version-Release number of selected component (if applicable): How reproducible: Create MHC with `maxUnhealthy` set to `2%0` Actual results: Remediation will occur if no more than 20% of nodes are unhealthy Expected results: An error should be returned as `2%0` is not a valid value Additional info:
Validated on : [miyadav@miyadav ManualRun]$ oc get clusterversion NAME VERSION AVAILABLE PROGRESSING SINCE STATUS version 4.5.0-0.nightly-2020-04-26-225842 True False 46m Cluster version is 4.5.0-0.nightly-2020-04-26-225842 Reproducible Always Steps : 1.Create a mhc , use below yml. oc create -f mhc.yml --- apiVersion: machine.openshift.io/v1beta1 kind: MachineHealthCheck metadata: creationTimestamp: "2020-02-14T09:47:08Z" generation: 1 name: mhc1 namespace: openshift-machine-api resourceVersion: "71059" selfLink: /apis/machine.openshift.io/v1beta1/namespaces/openshift-machine-api/machinehealthchecks/mhc-miyadav-1402-drlvf-worker-us-east-2c uid: ef74b735-e58e-4c24-aa69-015d90998b77 spec: maxUnhealthy: 2%0 selector: matchLabels: machine.openshift.io/cluster-api-cluster: miyada-x5rl5 machine.openshift.io/cluster-api-machine-role: worker machine.openshift.io/cluster-api-machine-type: worker machine.openshift.io/cluster-api-machineset: miyada-x5rl5-w-a unhealthyConditions: - status: "False" timeout: 300s type: Ready - status: Unknown timeout: 300s type: Ready 2.Delete the machine containing the machineset that we are monitoring using the mhc. oc delete machine miyada-x5rl5-w-a-gf8wr Actual & Expected : machine.machine.openshift.io "miyada-x5rl5-w-a-gf8wr" deleted 3.Monitor logs, mhc should not be triggered but gives error msg as below : Actual: W0427 09:09:35.411030 1 machinehealthcheck_controller.go:187] Reconciling openshift-machine-api/mhc1: total targets: 1, maxUnhealthy: 2%0, unhealthy: 1. Short-circuiting remediation I0427 09:09:41.927580 1 machinehealthcheck_controller.go:152] Reconciling openshift-machine-api/mhc1 I0427 09:09:41.927614 1 machinehealthcheck_controller.go:165] Reconciling openshift-machine-api/mhc1: finding targets I0427 09:09:41.927727 1 machinehealthcheck_controller.go:277] Reconciling openshift-machine-api/mhc1/miyada-x5rl5-w-a-456hk/miyada-x5rl5-w-a-456hk.c.openshift-qe.internal: health checking I0427 09:09:41.927742 1 machinehealthcheck_controller.go:291] Reconciling openshift-machine-api/mhc1/miyada-x5rl5-w-a-456hk/miyada-x5rl5-w-a-456hk.c.openshift-qe.internal: is likely to go unhealthy in 4m50.072266761s E0427 09:09:41.939136 1 machinehealthcheck_controller.go:242] openshift-machine-api/mhc1: error decoding maxUnhealthy, remediation won't be allowed: invalid value for IntOrString: invalid value "2%0": strconv.Atoi: parsing "2%0": invalid syntax Additional info: Can we review the error message to make it more simpler. Example : error decoding maxUnhealthy, remediation won't be allowed: invalid value for maxUnhealthy: It should be either integer or percent
moving to VERIFIED , looks good for now, may be later if it feels the message needs to be improved , we can have PR.
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, 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/RHBA-2020:2409