Bug 1825851
| Summary: | MHC MaxUnhealthy allows malformed value `2%0` | ||
|---|---|---|---|
| Product: | OpenShift Container Platform | Reporter: | Joel Speed <jspeed> |
| Component: | Cloud Compute | Assignee: | Joel Speed <jspeed> |
| Cloud Compute sub component: | Other Providers | QA Contact: | Milind Yadav <miyadav> |
| Status: | CLOSED ERRATA | Docs Contact: | |
| Severity: | low | ||
| Priority: | unspecified | ||
| Version: | 4.5 | ||
| Target Milestone: | --- | ||
| Target Release: | 4.5.0 | ||
| Hardware: | Unspecified | ||
| OS: | Unspecified | ||
| Whiteboard: | |||
| Fixed In Version: | Doc Type: | Bug Fix | |
| Doc Text: |
Cause: Entering an invalid string containing a percentage sign for the MaxUnhealthy field on an MHC would be interpreted as a percentage value (eg "2%0" would be interpreted as "20%")
Consequence: The MaxUnhealthy field had unpredictable behaviour and Machines may have been remediated when they were not intended to be remediated
Fix: Ensure the percentage sign is the last character before assuming the value is a percentage
Result: Entering a malformed value such as "2%0" now results in an error being returned
|
Story Points: | --- |
| Clone Of: | Environment: | ||
| Last Closed: | 2020-07-13 17:29:07 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
Joel Speed
2020-04-20 12:14:59 UTC
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 |