Bug 1764092 - [MHC] String value on maxUnhealthy reveals typo in machinehealthcheck_controller
Summary: [MHC] String value on maxUnhealthy reveals typo in machinehealthcheck_controller
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: OpenShift Container Platform
Classification: Red Hat
Component: Cloud Compute
Version: 4.3.0
Hardware: Unspecified
OS: Unspecified
low
low
Target Milestone: ---
: 4.3.0
Assignee: Alberto
QA Contact: Jianwei Hou
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2019-10-22 08:55 UTC by Jianwei Hou
Modified: 2020-01-23 11:08 UTC (History)
0 users

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2020-01-23 11:08:30 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Github openshift machine-api-operator pull 425 0 None closed bug 1764092: fix typo logging 2020-11-19 17:07:06 UTC
Red Hat Product Errata RHBA-2020:0062 0 None None None 2020-01-23 11:08:49 UTC

Description Jianwei Hou 2019-10-22 08:55:08 UTC
Description of problem:
Set a random string on spec.maxUnhealthy which can not be decoded, for example:

apiVersion: "healthchecking.openshift.io/v1alpha1"
kind: "MachineHealthCheck"
metadata:
  name: jhou-tssxr-worker-centralus1
  namespace: openshift-machine-api
spec:
  selector:
    matchLabels:
      machine.openshift.io/cluster-api-cluster: jhou-7x7zx
      machine.openshift.io/cluster-api-machine-role: worker
      machine.openshift.io/cluster-api-machine-type: worker
      machine.openshift.io/cluster-api-machineset: jhou-7x7zx-worker-centralus2
  unhealthyConditions:
  - type: Ready
    status: "False"
    timeout: 300s
  - type: Ready
    status: Unknown
    timeout: 300s
  maxUnhealthy: randomstring

Then mhc controller reported 
```
E1022 08:44:23.384973       1 machinehealthcheck_controller.go:173] openshift-machine-api/jhou-tssxr-worker-centralus1: error decoding maxUnavailable, remediation won't be allowed: invalid value for IntOrString: invalid value "randomstring": strconv.Atoi: parsing "randomstring": invalid syntax
```

In the message, "maxUnavailable" should be "maxUnhealthy" to avoid misunderstanding of end user.

Version-Release number of selected component (if applicable):
4.3.0-0.ci-2019-10-22-005014

How reproducible:
Always

Steps to Reproduce:
1. Create the mhc as the example and monitor the mhc controller.

Actual results:
As description

Expected results:
Text "maxUnavailable" should be "maxUnhealthy"

Additional info:
https://github.com/openshift/machine-api-operator/blob/master/pkg/controller/machinehealthcheck/machinehealthcheck_controller.go#L173

Comment 3 Jianwei Hou 2019-10-24 03:47:04 UTC
Verified in 4.3.0-0.ci-2019-10-23-170752

E1024 03:45:48.360718       1 machinehealthcheck_controller.go:173] openshift-machine-api/jhou-tssxr-worker-centralus1: error decoding maxUnhealthy, remediation won't be allowed: invalid value for IntOrString: invalid value "node": strconv.Atoi: parsing "node": invalid syntax

Comment 5 errata-xmlrpc 2020-01-23 11:08:30 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, 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:0062


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